Add deprecated, deprecationWarning fields to CRDs#92329
Add deprecated, deprecationWarning fields to CRDs#92329k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
3b12241 to
a8e56e7
Compare
|
/retest |
1 similar comment
|
/retest |
|
/cc @roycaihw |
|
/hold |
|
/lgtm |
|
/retest |
1 similar comment
|
/retest |
|
/assign @lavalamp |
| // deprecated indicates this version of the custom resource API is deprecated. | ||
| // When set to true, API requests to this version receive a warning header in the server response. | ||
| // Defaults to false. | ||
| Deprecated bool |
There was a problem hiding this comment.
Why don't we simply require someone to write their own DeprecationWarning and avoid having a bool? I haven't read all the way down, but I doubt we have a very good stock message on these since versions don't follow kube versions.
There was a problem hiding this comment.
The normal case of "X is deprecated" or "X is deprecated; use Y instead" is easy for us to automatically construct, and seemed valuable for consistency with built-in API deprecation warnings in the absence of specific additional information about removal timeframes.
CRD authors indicating a version is deprecated without knowledge of the cadence at which consumers plan to deploy the revision of the CRD which stops serving the deprecated version would not be able to provide a much better message than the one we're generating by default.
| return ret, nil | ||
| } | ||
|
|
||
| func defaultDeprecationWarning(deprecatedVersion string, crd apiextensionsv1.CustomResourceDefinitionSpec) string { |
There was a problem hiding this comment.
versions for CRDs mapping to kube versions somehow seems weird. I'd rather avoid this entire method by requiring the deprecation string.
There was a problem hiding this comment.
This is following the same rules we already follow when determining the order we present the CRD versions in discovery
|
/lgtm |
|
/hold cancel |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implements CRD warnings portion of https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1693-warnings / kubernetes/enhancements#1693
Does this PR introduce a user-facing change?:
/sig api-machinery
/cc @deads2k
/area custom-resources