Skip to content

Commit da37b7f

Browse files
authored
Merge pull request kubernetes#92329 from liggitt/crd-deprecation
Add deprecated, deprecationWarning fields to CRDs
2 parents a794874 + 30e39c7 commit da37b7f

20 files changed

+1007
-372
lines changed

api/openapi-spec/swagger.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ type CustomResourceDefinitionVersion struct {
177177
// Storage flags the version as storage version. There must be exactly one flagged
178178
// as storage version.
179179
Storage bool
180+
// deprecated indicates this version of the custom resource API is deprecated.
181+
// When set to true, API requests to this version receive a warning header in the server response.
182+
// Defaults to false.
183+
Deprecated bool
184+
// deprecationWarning overrides the default warning returned to API clients.
185+
// May only be set when `deprecated` is true.
186+
// The default warning indicates this version is deprecated and recommends use
187+
// of the newest served version of equal or greater stability, if one exists.
188+
DeprecationWarning *string
180189
// Schema describes the schema for CustomResource used in validation, pruning, and defaulting.
181190
// Top-level and per-version schemas are mutually exclusive.
182191
// Per-version schemas must not all be set to identical values (top-level validation schema should be used instead)

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.pb.go

Lines changed: 263 additions & 185 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/generated.proto

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ type CustomResourceDefinitionVersion struct {
174174
// storage indicates this version should be used when persisting custom resources to storage.
175175
// There must be exactly one version with storage=true.
176176
Storage bool `json:"storage" protobuf:"varint,3,opt,name=storage"`
177+
// deprecated indicates this version of the custom resource API is deprecated.
178+
// When set to true, API requests to this version receive a warning header in the server response.
179+
// Defaults to false.
180+
// +optional
181+
Deprecated bool `json:"deprecated,omitempty" protobuf:"varint,7,opt,name=deprecated"`
182+
// deprecationWarning overrides the default warning returned to API clients.
183+
// May only be set when `deprecated` is true.
184+
// The default warning indicates this version is deprecated and recommends use
185+
// of the newest served version of equal or greater stability, if one exists.
186+
// +optional
187+
DeprecationWarning *string `json:"deprecationWarning,omitempty" protobuf:"bytes,8,opt,name=deprecationWarning"`
177188
// schema describes the schema used for validation, pruning, and defaulting of this version of the custom resource.
178189
// +optional
179190
Schema *CustomResourceValidation `json:"schema,omitempty" protobuf:"bytes,4,opt,name=schema"`

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.conversion.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)