U
    id                     @   s&   d dl mZmZ G dd deeZdS )    )PluginUbuntuPluginc                   @   s4   e Zd ZdZdZdZdZdZdZdd Z	dd	 Z
d
S )Microk8sa  The Microk8s plugin collects the current status of the microk8s
    snap on a Ubuntu machine.

    It will collect logs from journald related to the snap.microk8s
    units as well as run microk8s commands to retrieve the configuration,
    status, version and loaded plugins.
    zThe lightweight Kubernetesmicrok8s)Z	container)r   c                 C   s4   | j dd ddddddg}| d	d
 |D  d S )Nzsnap.microk8s.*)Zunitszaddons repo listZconfigzctr plugins lszctr plugins ls -dZstatusversionc                 S   s   g | ]}d | qS )z	microk8s  ).0Zsubcmdr   r   =/usr/lib/python3/dist-packages/sos/report/plugins/microk8s.py
<listcomp>,   s    z"Microk8s.setup.<locals>.<listcomp>)Zadd_journalZadd_cmd_output)selfZmicrok8s_subcmdsr   r   r	   setup    s    	
zMicrok8s.setupc                 C   s   d}|  d|d d S )Nz((certificate-authority-data:|token:)\s.*r   z\1 "**********")Zdo_cmd_output_sub)r   Zrsubr   r   r	   postproc0   s    zMicrok8s.postprocN)__name__
__module____qualname____doc__Z
short_descZplugin_nameZprofilesZpackagesZmicrok8s_cmdr   r   r   r   r   r	   r      s   r   N)Zsos.report.pluginsr   r   r   r   r   r   r	   <module>   s   