New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`kubectl get pods --sort-by` no longer sorts correctly #71753

Closed
zx8 opened this Issue Dec 5, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@zx8

zx8 commented Dec 5, 2018

What happened:
kubectl get pods --sort-by=.metadata.creationTimestamp seems to have regressed in v1.13.0 and no longer sorts by creation timestamp.

What you expected to happen:
kubectl get pods --sort-by=.metadata.creationTimestamp should sort by creation timestamp.

How to reproduce it (as minimally and precisely as possible):

$ for i in {1..5}; do kubectl create deployment foobar-$i --image=nginx; sleep 5; done
deployment.apps/foobar-1 created
deployment.apps/foobar-2 created
deployment.apps/foobar-3 created
deployment.apps/foobar-4 created
deployment.apps/foobar-5 created

$ kubectl get pods --sort-by=.metadata.creationTimestamp
NAME                        READY   STATUS    RESTARTS   AGE
foobar-1-859fd647ff-72jgp   1/1     Running   0          32s
foobar-2-89d4d78b6-4tt5h    1/1     Running   0          27s
foobar-3-8b74c8cb9-w77c9    1/1     Running   0          22s
foobar-4-5c6b995944-dmx5v   1/1     Running   0          17s
foobar-5-7f79d8957f-vghlc   1/1     Running   0          12s

$ kube delete po foobar-3-8b74c8cb9-w77c9
pod "foobar-3-8b74c8cb9-w77c9" deleted

$ kubectl get pods --sort-by=.metadata.creationTimestamp
NAME                        READY   STATUS        RESTARTS   AGE
foobar-1-859fd647ff-72jgp   1/1     Running       0          47s
foobar-2-89d4d78b6-4tt5h    1/1     Running       0          42s
foobar-4-5c6b995944-dmx5v   1/1     Running       0          32s
foobar-3-8b74c8cb9-wmr4h    1/1     Running       0          3s   <-- !!! BUG !!!
foobar-5-7f79d8957f-vghlc   1/1     Running       0          27s

$ brew switch kubectl 1.12.3
Cleaning /usr/local/Cellar/kubernetes-cli/1.13.0
Cleaning /usr/local/Cellar/kubernetes-cli/1.12.3
203 links created for /usr/local/Cellar/kubernetes-cli/1.12.3

$ kubectl get pods --sort-by=.metadata.creationTimestamp
NAME                        READY   STATUS    RESTARTS   AGE
foobar-1-859fd647ff-72jgp   1/1     Running   0          1m
foobar-2-89d4d78b6-4tt5h    1/1     Running   0          1m
foobar-4-5c6b995944-dmx5v   1/1     Running   0          51s
foobar-5-7f79d8957f-vghlc   1/1     Running   0          46s
foobar-3-8b74c8cb9-wmr4h    1/1     Running   0          22s

Anything else we need to know?:
N/A

Environment:

  • Kubernetes version (use kubectl version):
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-04T07:48:45Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.3-gke.18", GitCommit:"35471a6a3958f610351c67208de0f3824c4e8b3d", GitTreeState:"clean", BuildDate:"2018-11-14T05:27:44Z", GoVersion:"go1.10.3b4", Compiler:"gc", Platform:"linux/amd64"}

/kind bug

@zx8

This comment has been minimized.

zx8 commented Dec 5, 2018

/sig cli

@k8s-ci-robot k8s-ci-robot added sig/cli and removed needs-sig labels Dec 5, 2018

@WanLinghao

This comment has been minimized.

Contributor

WanLinghao commented Dec 6, 2018

/assign

@liggitt liggitt added this to the v1.13 milestone Dec 6, 2018

@liggitt

This comment has been minimized.

Member

liggitt commented Dec 6, 2018

bisected to dba032d (#70629)

/assign @soltysh

@liggitt

This comment has been minimized.

Member

liggitt commented Dec 6, 2018

opened #71805 to fix

@liggitt

This comment has been minimized.

Member

liggitt commented Dec 6, 2018

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment