-
Notifications
You must be signed in to change notification settings - Fork 40k
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
k8s 1.16 custom object resource version changes on status patch #86771
Comments
@apoorva-05: The label(s) 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. |
1 similar comment
@apoorva-05: The label(s) 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. |
/sig api-machinery |
/sig api-machinery |
I'm unable to reproduce this status.yaml: apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: foos.example.com
spec:
group: example.com
scope: Namespaced
versions:
- name: v1
storage: true
served: true
- name: v2
storage: false
served: true
subresources:
status: {}
names:
singular: foo
plural: foos
kind: Foo
listKind: FooList
---
apiVersion: example.com/v1
kind: Foo
metadata:
name: foo
spec:
specValue: true
status:
specValue: true kubectl version
kubectl create -f status.yaml
kubectl get foo/foo -o yaml
curl -X PATCH \
-H "Content-Type: application/json-patch+json" \
--data-binary '[{"op": "replace","path": "/status","value": {"state":"ERROR", "status_message":"done"}}]' \
http://localhost:8080/apis/example.com/v2/namespaces/default/foos/foo/status
kubectl get foo/foo -o yaml
curl -X PATCH \
-H "Content-Type: application/json-patch+json" \
--data-binary '[{"op": "replace","path": "/status","value": {"state":"ERROR", "status_message":"done"}}]' \
http://localhost:8080/apis/example.com/v2/namespaces/default/foos/foo/status
kubectl get foo/foo -o yaml
|
can you start a |
@liggitt is this the correct command? Created the yamls
Resource version of foo object before status update
Applied the patch
Output of foo object after patch
Not sure what i am missing. Is there any cluster level changes/flags which needs to be enabled for the status subresource to work? |
I see that in your case the resource Version changed from "317" to "331" after the PATCH of the status. Does this mean, that this behavior is expected? |
Yes, whenever the status update actually results in a change, the resourceVersion is expected to change. Note that the second time the identical patch was submitted, it was a no-op, and the resourceVersion did not change. |
What happened:
In kubernetes 1.16.2 patching a status subresource of a custom object with a body that effectively does nothing increases the resource version of the object and triggers modify events.
I see that a bug was already raised and its fixed(#67541 might be a regression.
What you expected to happen:
Applying a patch that does not change the resource the object resource version should not change and no modify event be triggered.
How to reproduce it (as minimally and precisely as possible):
Applying a status patch with "Content-Type: application/json-patch+json" with the following patch.json is incrementing the resource Version
[{"op": "replace","path": "/status","value": {"state":"ERROR", "status_message":"done"}}]
Anything else we need to know?:
Environment:
kubectl version
):Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:09:08Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
cat /etc/os-release
):NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
uname -a
):Linux highend-node1 4.4.0-116-generic PreStart and PostStop event hooks #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: