JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr O6uf8ddlZddlmZmZmZGddeeZy)N)Plugin RedHatPlugin PluginOptceZdZdZdZdZdZdZefZefZ dZ e de e de d d e d e d d e d gZ dZdZdZdZdZy) 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)rzmicroshift-selinuxzmicroshift-networkingz2/var/lib/microshift/resources/kubeadmin/kubeconfig kubeconfigz+Path to a locally available kubeconfig file)defaultval_typedesconly-namespacesz2colon-delimited list of namespaces to collect fromadd-namespaceszHcolon-delimited list of namespaces to add to the default collection listc|jdr)t|jdjdSddg}|jdr:|jdjdD]}|jd|d|S)zCombine 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. r :z^openshift\-.+$z ^kube\-.+$r^$) get_optionlistsplitappend)selfcollect_regexesnsps ?/usr/lib/python3/dist-packages/sos/report/plugins/microshift.py_setup_namespace_regexesz#Microshift._setup_namespace_regexes,s ??, -(9:@@EF F    ??+ ,'78>>sC 4&&!C5{3 4chd|jttfd|DS)aReduce 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 cB|D]}tj||syy)zMatch a particular namespace for inclusion (or not) in the collection phases :param namespace str: The name of a namespace TF)rematch) namespaceregexesregexs r_match_namespacez;Microshift._reduce_namespace_list.._match_namespaceGs)! 88E9- rc36K|]}|s |yw)N).0nr%r#s r z4Microshift._reduce_namespace_list..UsHa+;Aw+GHs)rrset)rnspsr%r#s @@r_reduce_namespace_listz!Microshift._reduce_namespace_list?s. //1CH4HHIIrc|jd|jd}|ddk(r#|j|djdSgS)NzRoc get namespaces -o custom-columns=NAME:.metadata.name --no-headers --kubeconfig=r statusroutput )exec_cmdrr-r)rress r_get_namespaceszMicroshift._get_namespacesWs^mm "__\:; => x=A ..s8}/B/B4/HI I rcgd}g}|D]R}|jd|jdd|tj}|ddk(sB|j |T|S)z@Get cluster-level (non-namespaced) resources to collect ) apiservicescertificatesigningrequestsclusterrolebindings clusterrolescomponentstatuses csidriverscsinodescustomresourcedefinitions flowschemasingressclasseslogicalvolumesmutatingwebhookconfigurationsnodespersistentvolumespriorityclassesprioritylevelconfigurationsrangeallocationsruntimeclassessecuritycontextconstraintsselfsubjectaccessreviewsselfsubjectrulesreviewsstorageclassessubjectaccessreviews tokenreviewsvalidatingwebhookconfigurationsvolumeattachmentszoc get --kubeconfig r  )timeoutr/r)r2rrplugin_timeoutr)rglobal_resources_filtered_resourcesresourcer3s r_get_cluster_resourcesz!Microshift._get_cluster_resourcesas~ :!( 5H--&t|'D&EQ*"11 3C8}!#**84  5#"rc|jd|jd|jdr|jddg|jdg|jddgd j |j }d j |j Dcgc]}d | c}}|jtjrz|jd }|jd}|jd|d|d |dtj|jd|d|d |dtjyycc}w)aThe setup() phase of this plugin will first gather system information and then iterate through all default namespaces, and/or those specified via the `add-namespaces` and `only-namespaces` plugin options. Both of these options accept shell-style regexes. Output format for this function is based on `oc adm inspect` command, which is used to retrieve all API resources from the cluster. zmicroshift-etcd.scopez/etc/microshiftz/var/lib/microshift-backupsz%/var/lib/microshift-backups/*/versionz"/var/lib/microshift-backups/*.jsonz/var/log/kube-apiserver/*.logzmicroshift versionz#microshift show-config -m effective,rPzns/F)maker zoc adm inspect --kubeconfig z --dest-dir zinspect_cluster_resources.log)suggest_filenamerQzinspect_namespaces.logN) add_journal add_copy_spec path_existsadd_cmd_outputjoinrVr4is_service_runningr plugin_nameget_cmd_output_pathrrR)r_cluster_resources_to_collectr)_namespaces_to_collect_subdir _kubeconfigs rsetupzMicroshift.setupsw 01 ,-   9 :    G D F G ;<=  1  ),  ' ' ))+%!$ $ 4 4 6 71s1#Y 7"9  " ":#9#9 :..E.:G//,7K   .{m<)1:;=!@"11  3   .{m<)1346!9"11  3 ; 8s( EN)__name__ __module__ __qualname____doc__ short_descrarRpackagesservicesprofileslocalhost_kubeconfigrstr option_listrr-r4rVrgr'rrrrs JKNMH~H~HO ,(rts  >>f3f3r