[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
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 diff feature always returns empty #61145

Closed
toothbrush opened this issue Mar 14, 2018 · 3 comments · Fixed by #61227
Closed

kubectl diff feature always returns empty #61145

toothbrush opened this issue Mar 14, 2018 · 3 comments · Fixed by #61227
Assignees
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@toothbrush
Copy link

/kind bug
/sig cli
/area kubectl

Hello. This is my first interaction with the Kubernetes community, so please forgive me if i have left out any crucial details, or if, perhaps, this is PEBKAC after all!

I am keen to have a working kubectl diff feature, as described in #6284 and kubernetes/enhancements#491. I am running K8s v1.9.3 and realise that this feature is in alpha, but i thought i would ask anyway. We're not on v1.9.4 yet, but the changelog doesn't mention the diff feature.

What you expected to happen:

I have some services deployed to Kubernetes with YAML files, that has been working reliably. We always use kubectl apply -f ... to deploy things. When a service is already deployed, and i make a minor change in the config file, for example the service port, i expect to see that in the diff. Instead, kubectl gives no output and exits with a 0.

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

Consider the file kube2iam.yaml:

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: kube2iam
  namespace: kube-system
  labels:
    app: kube2iam
spec:
  template:
    metadata:
      labels:
        name: kube2iam
    spec:
      hostNetwork: true
      tolerations:
      - key: "role"
        operator: "Equal"
        value: "controller"
      containers:
        - image: jtblin/kube2iam:latest
          name: kube2iam
          args:
            - "--auto-discover-default-role"
            - "--verbose"
          ports:
            - containerPort: 8181
              hostPort: 8181
              name: http

I make sure that it is correctly running on the cluster:

kubectl apply -f ./kube2iam.yaml
daemonset "kube2iam" unchanged

Great, looking good. Now, i change the spec.template.spec.containers[0].image value to use Docker image tag master and save.

Now, i run:

kubectl alpha diff -f ./kube2iam.yaml

The stderr/stdout output is empty, and the exit code is 0.

Anything else we need to know?:

Environment:

  • Kubernetes version:

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-09T21:50:44Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3+coreos.0", GitCommit:"f588569ed1bd4a6c986205dd0d7b04da4ab1a3b6", GitTreeState:"clean", BuildDate:"2018-02-10T01:42:55Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI. area/kubectl labels Mar 14, 2018
@nottrobin
Copy link

I have this same issue - if I change, say, spec: replicas: 5 to spec: replicas: 3 in my config.yaml, running kubectl alpha diff -f config.yaml returns empty.

If I try tweaking the version I'm diffing (which I don't understand) - e.g. kubectl alpha diff -f config.yaml LAST MERGED - then I see a bunch of differences, but not actually the change I was expecting in the number of replicas.

@apelisse
Copy link
Member

I'll take this. Sorry for the inconvenience.

@wangzhen127
Copy link
Member

@wangzhen127

k8s-github-robot pushed a commit that referenced this issue May 16, 2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

diff: Fix broken `Local()` logic

Local and Live functions where doing and returning the same thing,
giving empty results by default. Fix the local function by copying the
objects before fetching the live version.



**What this PR does / why we need it**: Diff prints empty output by default. Fixes it.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #61145

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants