Adding debug command for sylvactl
A dedicated subcommand for sylvactl to print the diagnosis summary of the resources at once. Below are the flags introduced to filter resources based on their status (Success or Failed or Not Ready ) and type(HelmRepository, HelmRelease, Kustomisation, OCIRepository):
- To list all resources: sylvactl debug
- To list resources with status containing "Succeeded": sylvactl debug --status-filter Succeeded
- To list only HelmChart resources: sylvactl debug --resource-type HelmChart
- To list resources with status 'Failed' or 'NotReady': sylvactl debug --status-check Failed,NotReady
- To combine filters: sylvactl debug --resource-type HelmChart --status-check Failed
Below is the output using different flags:
$ sylvactl debug --resource-type Kustomization --status-check Failed
Resource: Kustomization/worker-node-27/cluster
Status: HealthCheckFailed - health check failed after 30.048398245s: timeout waiting for: [OpenStackCluster/worker-node-27/worker-node-27 status: 'NotFound', RKE2ControlPlane/worker-node-27/worker-node-27-control-plane status: 'NotFound', Secret/worker-node-27/worker-node-27-kubeconfig status: 'NotFound', HelmRelease/worker-node-27/cluster status: 'InProgress', Cluster/worker-node-27/worker-node-27 status: 'NotFound']
$ sylvactl debug --resource-type OCIRepository
Resource: OCIRepository/capi-rancher-import/capi-rancher-import-cattle-agent-kustomize
Status: Succeeded - stored artifact for digest '0.1.5@sha256:514e4afd11964ee693bc9ee23952598af0505e340fb40c0b97f73421183bcec4'
Resource: OCIRepository/my-k8s-v1-27-vm-cluster/otc-caas-release
Status: Succeeded - stored artifact for digest '1.0.1@sha256:31bef2f351b1d25871968ad1037d13786709d62d15856ed03fe1c785b6af117d'
Resource: OCIRepository/my-k8s-v1-27-vm-cluster/sylva-core
Status: Succeeded - stored artifact for digest '1.1.1@sha256:a3424fc800095e5cda897ce54d122f72e1ac16b0547a1506f9d2a628867476cb'
Resource: OCIRepository/sylva-system/otc-caas
Status: Succeeded - stored artifact for digest '1.0.1@sha256:31bef2f351b1d25871968ad1037d13786709d62d15856ed03fe1c785b6af117d'
Resource: OCIRepository/sylva-system/otc-caas-release
Status: Succeeded - stored artifact for digest '1.0.1@sha256:31bef2f351b1d25871968ad1037d13786709d62d15856ed03fe1c785b6af117d'
Resource: OCIRepository/sylva-system/sylva-core
Status: Succeeded - stored artifact for digest '1.1.1@sha256:a3424fc800095e5cda897ce54d122f72e1ac16b0547a1506f9d2a628867476cb'
Resource: OCIRepository/worker-node-27/otc-caas-release
Status: Succeeded - stored artifact for digest '1.0.1@sha256:31bef2f351b1d25871968ad1037d13786709d62d15856ed03fe1c785b6af117d'
Resource: OCIRepository/worker-node-27/sylva-core
Status: Succeeded - stored artifact for digest '1.1.1@sha256:a3424fc800095e5cda897ce54d122f72e1ac16b0547a1506f9d2a628867476cb'
Edited by sakshi gupta