-
Notifications
You must be signed in to change notification settings - Fork 924
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 requires update / patch permission #981
Comments
kubectl supports +1/-1 version of the api server so your v1.19.3 client is pretty off from our version skew policy. You could try using an older kubectl version or upgrading your cluster to a supported version. Please reopen if you run into this with a supported version. /close |
@eddiezane: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @eddiezane Here is a minimal example:
/reopen |
@mbrancato: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Yes this is the current expected behavior: https://kubernetes.io/docs/reference/using-api/api-concepts/#dry-run-authorization This issue is a duplicate of kubernetes/kubernetes#95449 |
Thanks @julianvmodesto. Let's track this there. /close |
@eddiezane: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'll move discussion there, but as the title says my issue is the patch permission requirement and specifically for |
Relates to kubernetes/kubernetes#95449 |
Reopening this. The other discussion went nowhere. To maybe make it more clear, comparing the deployed state and a local manifest should not be relying on write or patch permissions to a cluster. And I think that is where the misunderstanding is. At a minimum, the The same issue of e.g.
/reopen |
@mbrancato: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
@mbrancato apologies for the friction here. You are correct and this appears to be a valid issue. A client side only diff should not be making a PATCH request. This is because it's currently hard coded to use dry run. This is a bug and should be fixed. /triage accepted |
One point of friction is that the I don't think this is a bug because diff is intended to only diff a live object against the new patched object. It sounds like this request is for a client-side version of diff, with the live object retrieved from the server diffed against a patched object that's constructed locally. I think this sounds close to #1147. |
If that is the case, I think the help text from
I interpret this as being able to diff the current online configuration with some offline configuration, and be able to see what would change if the offline configuration was applied to the online configuration. As long as I have permission to get the current online configuration, I would expect to be able to see what would change as well. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can this be reopened again? Read only diff would be extremely useful, especially in pipelines for pull requests. |
/reopen |
@mbrancato: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
if you landed here looking for a way to incorporate edit: the project looks dead, the markdown diff output is kind of crap (e.g. it will say "Error: Missing" if something is missing on the server), and the json output is limited. |
Any updates? |
It's weird how such useful and obvious command doesn't work as expected and it's help command is misleading. Any updates would be appreciated. |
What happened:
Usually, when we think about using
diff
to compare two things - write access is not required. In this case, it seemskubectl diff
requires write access to compare the current and future state. This might be an upstream problem if this is due to the server side apply.When doing
kubectl diff
on a Deployment:It seems to require PATCH / PUT permission under
/apis/apps/v1/namespaces/{namespace}/deployments/*
or older/apis/extensions/v1beta1/namespaces/{namespace}/deployments/*
.What you expected to happen:
Diff output to be shown.
How to reproduce it (as minimally and precisely as possible):
Attempt to diff a Deployment resource from a user lacking write access to the deployment. The permission in the example above is mapped to GKE specifically.
Anything else we need to know?:
Environment:
kubectl version
):cat /etc/os-release
): n/aThe text was updated successfully, but these errors were encountered: