Skip to content

kubectl get pods behavior differs based on output mode wrt Failed pods #15179

Closed
@thockin

Description

I don't knwo what to make of this:

$ kubectl get pods --namespace kube-system -l k8s-app=kube-registry
NAME                     READY     STATUS    RESTARTS   AGE
kube-registry-v0-eicif   1/1       Running   0          34m

This much was expected.

$ kubectl get pods --namespace kube-system -l k8s-app=kube-registry -o name
pod/kube-registry-v0-32ls6
pod/kube-registry-v0-66ugd
pod/kube-registry-v0-7baw4
pod/kube-registry-v0-8f6kk
pod/kube-registry-v0-dghdh
pod/kube-registry-v0-eicif
pod/kube-registry-v0-kgxf0
pod/kube-registry-v0-kuh1v
pod/kube-registry-v0-me1yd
pod/kube-registry-v0-n53wo
pod/kube-registry-v0-nkkq0
pod/kube-registry-v0-psk57
pod/kube-registry-v0-tbg6q
pod/kube-registry-v0-u7huo
pod/kube-registry-v0-v9960

This was a surprise!

$ kubectl get pods --namespace kube-system -l k8s-app=kube-registry -o template --template '{{range .items}}{{.status.phase}}{{"\n"}}{{end}}'
Failed
Failed
Failed
Failed
Failed
Running
Failed
Failed
Failed
Failed
Failed
Failed
Failed
Failed
Failed

Is the behavior supposed to be different?

Metadata

Assignees

Labels

area/kubectllifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/cliCategorizes an issue or PR as relevant to SIG CLI.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions