Sindbad~EG File Manager
3
�f� � @ s2 d dl Z d dlmZmZmZ G dd� dee�ZdS )� N)�Plugin�RedHatPlugin� PluginOptc @ s� e Zd ZdZd ZdZdZdZefZefZ dZ
ede
edd �ed
dedd �ed
dedd �gZ
dd� Zdd� Zdd� Zdd� Zdd� ZdS )�
Microshifta: This is the plugin for MicroShift 4.X. Even though it shares some of
the OpenShift components, its IoT/Edge target makes the product nimble and
light, thus requiring different a approach when operating it.
When enabled, this plugin will collect cluster information (such as
systemd service logs, configuration, versions, etc.)and also inspect API
resources in certain namespaces. The namespaces to scan are kube.* and
openshift.*. Other namespaces may be collected by making use of the
``only-namespaces`` or ``add-namespaces`` options.
�
microshifti� �microshift-selinux�microshift-networkingz2/var/lib/microshift/resources/kubeadmin/kubeconfig�
kubeconfigz+Path to a locally available kubeconfig file)�defaultZval_typeZdesczonly-namespaces� z2colon-delimited list of namespaces to collect fromzadd-namespaceszHcolon-delimited list of namespaces to add to the default collection listc C s\ | j d�rt| j d�jd��S ddg}| j d�rXx&| j d�jd�D ]}|jd| � qBW |S )z�Combine a set of regexes for collection with any namespaces passed
to sos via the -k openshift.add-namespaces option. Note that this does
allow for end users to specify namespace regexes of their own.
zonly-namespaces�:z^openshift\-.+$z
^kube\-.+$zadd-namespacesz^%s$)�
get_option�list�split�append)�selfZcollect_regexesZnsp� r � /usr/lib/python3.6/microshift.py�_setup_namespace_regexes, s
z#Microshift._setup_namespace_regexesc s, dd� � | j � �tt� �fdd�|D ���S )a Reduce the namespace listing returned to just the ones we want to
collect from. By default, as requested by OCP support personnel, this
must include all 'openshift' prefixed namespaces
:param nsps list: Namespace names from oc output
c S s"