File: //lib/python3/dist-packages/sos/collector/clusters/__pycache__/kubernetes.cpython-38.pyc
U
i��dT � @ s, d dl mZ d dlmZ G dd� de�ZdS )� )�quote)�Clusterc @ s: e Zd ZdZdZdZd gZddiZdZddgZ d d
� Z
dS )�
kubernetesz�
The kuberentes cluster profile is intended to be used on kubernetes
clusters built from the upstream/source kubernetes (k8s) project. It is
not intended for use with other projects or platforms that are built ontop
of kubernetes.
zCommunity Kubernetes)zkubernetes-masterzkubernetes.allZonZkubectl)�label� z-Filter node list to those with matching label)�roler z,Filter node list to those with matching rolec C s� | j d7 _ | �d�r4| j dt| �d�� 7 _ | �| j �}|d dkr�g }dd� | �d��d �D �}|d
�� dd � D ]:}|�� }|s�|�|d � q~|d |kr~|�|d � q~|S td
��d S )Nz
get nodesr z -l %s Zstatusr c S s g | ]}|r|�qS � r )�.0�xr r �C/usr/lib/python3/dist-packages/sos/collector/clusters/kubernetes.py�
<listcomp>) s z(kubernetes.get_nodes.<locals>.<listcomp>r �,�output� � z-Node enumeration did not return usable output)�cmdZ
get_optionr Zexec_primary_cmd�split�
splitlines�append� Exception)�self�resZnodesZrolesZnodelnZnoder r r � get_nodes"