You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All edits to the podMetadata field of a Prometheus object are discarded by kube-apiserver.
Did you expect to see something different?
Data should be stored by kube-apiserver.
How to reproduce it (as minimally and precisely as possible):
Try to set a label or annotation using podMetadata.
Environment
Prometheus Operator version: 0.36.0
Kubernetes version information: 1.17.2
Kubernetes cluster kind: kops
Manifests:
podMetadata:
labels:
foo: bar
Prometheus Operator Logs: N/A (data never makes it that far.
Anything else we need to know?:
This was caused by a mix of #2855 where controller-tools didn't recurse into the ObjectMeta struct so it was changed in the generated CRD to be just a plain type: object with no fields. And then #2903 which disabled saving unknown fields so any data set on podMetadata will be discarded by apiserver since it has no declared fields. The same issue might be affecting other fields, I didn't do a check of the full diff from #2855.
Getting controller-tools to recurse outside of the current package is an old bug, we've run into it on our operators a few times, but hopefully an upgrade there would fix it? If not, I'm sure Solly could assist.
I tried updating to the latest version of controller-tools (v0.2.5) but it seems this is still an issue (kubernetes-sigs/controller-tools#385). There is a possible fix available (kubernetes-sigs/controller-tools#395), so a local patch might be an option until it's fixed in controller-tools master.
Activity
pgier commentedon Feb 25, 2020
I tried updating to the latest version of controller-tools (v0.2.5) but it seems this is still an issue (kubernetes-sigs/controller-tools#385). There is a possible fix available (kubernetes-sigs/controller-tools#395), so a local patch might be an option until it's fixed in controller-tools master.
pgier commentedon Feb 25, 2020
I created #3043 to test out the upstream patch. @coderanger can you give that one a try to see if it fixes the issue?
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type
replace ObjectMeta with custom PodMeta type