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

Different outputs from kubectl rollout history deployment (for different output formats) #72782

Open
hawran opened this Issue Jan 10, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@hawran
Copy link

hawran commented Jan 10, 2019

/sig cli

What happened:
Hi,
I've been experiencing strange behaviour of the kubectl rollout history deployment command with different output formats set up.
Based on the state as follows:

$ kubectl rollout history deployment XXX
deployment.extensions/XXX 
REVISION  CHANGE-CAUSE
39        kubectl apply --record=true --filename=/builds/Y/XXX/deployment/kubernetes/
40        kubectl apply --record=true --filename=/builds/Y/XXX/deployment/kubernetes/
41        kubectl apply --record=true --filename=/builds/Y/XXX/deployment/kubernetes/
$

I'm getting strange outputs (a pod with two containers, just snippets):

$ kubectl rollout history deployment XXX --revision=40|egrep 'revision|cpu'
deployment.extensions/XXX with revision #40
      cpu:      1
      cpu:      1
      cpu:      500m
      cpu:      500m
$

vs. (note different values)

$ kubectl rollout history deployment XXX --revision=40 -oyaml|egrep 'revision|cpu'
    deployment.kubernetes.io/revision: "41"
            cpu: 400m
            cpu: 200m
            cpu: 400m
            cpu: 200m
$

and

$ kubectl rollout history deployment XXX --revision=40 -ojson|egrep 'revision|cpu'
            "deployment.kubernetes.io/revision": "41",
                                "cpu": "400m",
                                "cpu": "200m",
                                "cpu": "400m",
                                "cpu": "200m",
$

vs. (correct values)

$ kubectl rollout history deployment XXX --revision=41|egrep 'revision|cpu'
deployment.extensions/XXX with revision #41
      cpu:      400m
      cpu:      200m
      cpu:      400m
      cpu:      200m
$

vs.

$ kubectl rollout history deployment XXX --revision=41 -ojson|egrep 'revision|cpu'
            "deployment.kubernetes.io/revision": "41",
                                "cpu": "400m",
                                "cpu": "200m",
                                "cpu": "400m",
                                "cpu": "200m",
$

where really (the deployment in use)

$ kubectl get deployment XXX -oyaml|egrep 'revision|cpu'
    deployment.kubernetes.io/revision: "41"
            cpu: 400m
            cpu: 200m
            cpu: 400m
            cpu: 200m
$

and

$ kubectl get deployment XXX -ojson|egrep 'revision|cpu'
            "deployment.kubernetes.io/revision": "41",
                                "cpu": "400m",
                                "cpu": "200m",
                                "cpu": "400m",
                                "cpu": "200m",
$

What you expected to happen:
I would expect same values for same revisions, regardless of the output format.
Or what am I missing?

How to reproduce it (as minimally and precisely as possible):
Deploy a couple of deployments and try to get info about deployment's revisions.

Anything else we need to know?:
This behaviour is same for all older deployments (with the output format specification).

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.4-dirty", GitCommit:"f49fa022dbe63faafd0da106ef7e05a29721d3f1", GitTreeState:"dirty", BuildDate:"2018-12-18T07:57:52Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.6", GitCommit:"a21fdbd78dde8f5447f5f6c331f7eb6f80bd684e", GitTreeState:"clean", BuildDate:"2018-07-26T10:04:08Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration:
    N/A
  • OS (e.g. from /etc/os-release):
    Ubuntu 16.04.3 LTS
  • Kernel (e.g. uname -a):
    4.14.40-infra (customised)
  • Install tools:
    N/A
  • Others:

@hawran hawran added the kind/bug label Jan 10, 2019

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