Azure / azure-capi-cli-extension

Kubernetes Cluster API support in the Azure CLI
MIT License
20 stars 18 forks source link

Don't echo JSON while waiting for nodes with --debug #174

Closed mboersma closed 1 year ago

mboersma commented 1 year ago

Description

az capi is very terse by design, unless you run with the --debug flag, in which case all command input and output are echoed.

Waiting for nodes using kubectl get nodes -o json wastes a huge amount of real estate on the screen or in the logs, and isn't necessary since we're just counting the number of Ready nodes. This PR changes it to this:

cli: kubectl get nodes --no-headers --kubeconfig flaxen-milepost.kubeconfig returned:
flaxen-milepost-control-plane-g9tkr   Ready      control-plane   2m36s   v1.25.3
flaxen-milepost-md-0-lqrc8            NotReady   <none>          14s     v1.25.3

cli: kubectl get nodes --no-headers --kubeconfig flaxen-milepost.kubeconfig returned:
flaxen-milepost-control-plane-g9tkr   Ready      control-plane   2m41s   v1.25.3
flaxen-milepost-md-0-lqrc8            NotReady   <none>          19s     v1.25.3

cli: kubectl get nodes --no-headers --kubeconfig flaxen-milepost.kubeconfig returned:
flaxen-milepost-control-plane-g9tkr   Ready   control-plane   2m57s   v1.25.3
flaxen-milepost-md-0-lqrc8            Ready   <none>          35s     v1.25.3

cli: ✓ Workload cluster is ready
cli: kubectl cluster-info returned:
Kubernetes control plane is running at https://127.0.0.1:64104
CoreDNS is running at https://127.0.0.1:64104/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

History Notes


This checklist is used to make sure that common guidelines for an Azure CLI pull request are followed.