Support for field-level deprecation warnings in CRD generation #4785
-
Hey While working on CRD schemas using kubebuilder, we came across an annotation similar to the following:
We noticed it's being used in some operators (e.g., cluster-group-upgrades-operator) to communicate deprecated fields in the Go code. However, it seems this tag does not result in any warning or metadata being emitted in the generated CRD YAML or OpenAPI schema. Is there currently a supported way to mark specific fields as deprecated so that end users receive warnings (e.g., via kubectl apply) when using those fields? If not, is this feature on the roadmap — or would it make sense for us to open a GH issue? Thanks a lot |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @gkech, I think you’re right. Annotations like I think it would be a good idea to open a GitHub issue on controller-tools to request this feature, since it is the project is responsible for supporting these markers. |
Beta Was this translation helpful? Give feedback.
Hi @gkech,
I think you’re right.
Annotations like
+kubebuilder:deprecatedversion:warning="..."
don’t seem to raise any actual warnings — they’re helpful in code, but not reflected in the generated CRD or OpenAPI schema.I think it would be a good idea to open a GitHub issue on controller-tools to request this feature, since it is the project is responsible for supporting these markers.