mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Add feature gate and API changes for multi-version
schema, subresources and columns
This commit is contained in:
parent
7e102de723
commit
e5587f52a7
@ -44,8 +44,14 @@ type CustomResourceDefinitionSpec struct {
|
|||||||
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
|
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
|
||||||
Scope ResourceScope
|
Scope ResourceScope
|
||||||
// Validation describes the validation methods for CustomResources
|
// Validation describes the validation methods for CustomResources
|
||||||
|
// Optional, the global validation schema for all versions.
|
||||||
|
// Top-level and per-version schemas are mutually exclusive.
|
||||||
|
// +optional
|
||||||
Validation *CustomResourceValidation
|
Validation *CustomResourceValidation
|
||||||
// Subresources describes the subresources for CustomResources
|
// Subresources describes the subresources for CustomResource
|
||||||
|
// Optional, the global subresources for all versions.
|
||||||
|
// Top-level and per-version subresources are mutually exclusive.
|
||||||
|
// +optional
|
||||||
Subresources *CustomResourceSubresources
|
Subresources *CustomResourceSubresources
|
||||||
// Versions is the list of all supported versions for this resource.
|
// Versions is the list of all supported versions for this resource.
|
||||||
// If Version field is provided, this field is optional.
|
// If Version field is provided, this field is optional.
|
||||||
@ -60,6 +66,9 @@ type CustomResourceDefinitionSpec struct {
|
|||||||
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
|
// v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
|
||||||
Versions []CustomResourceDefinitionVersion
|
Versions []CustomResourceDefinitionVersion
|
||||||
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
||||||
|
// Optional, the global columns for all versions.
|
||||||
|
// Top-level and per-version columns are mutually exclusive.
|
||||||
|
// +optional
|
||||||
AdditionalPrinterColumns []CustomResourceColumnDefinition
|
AdditionalPrinterColumns []CustomResourceColumnDefinition
|
||||||
|
|
||||||
// `conversion` defines conversion settings for the CRD.
|
// `conversion` defines conversion settings for the CRD.
|
||||||
@ -149,6 +158,27 @@ type CustomResourceDefinitionVersion struct {
|
|||||||
// Storage flags the version as storage version. There must be exactly one flagged
|
// Storage flags the version as storage version. There must be exactly one flagged
|
||||||
// as storage version.
|
// as storage version.
|
||||||
Storage bool
|
Storage bool
|
||||||
|
// Schema describes the schema for CustomResource used in validation, pruning, and defaulting.
|
||||||
|
// Top-level and per-version schemas are mutually exclusive.
|
||||||
|
// Per-version schemas must not all be set to identical values (top-level validation schema should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// +optional
|
||||||
|
Schema *CustomResourceValidation
|
||||||
|
// Subresources describes the subresources for CustomResource
|
||||||
|
// Top-level and per-version subresources are mutually exclusive.
|
||||||
|
// Per-version subresources must not all be set to identical values (top-level subresources should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// +optional
|
||||||
|
Subresources *CustomResourceSubresources
|
||||||
|
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
||||||
|
// Top-level and per-version columns are mutually exclusive.
|
||||||
|
// Per-version columns must not all be set to identical values (top-level columns should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an
|
||||||
|
// update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must
|
||||||
|
// be explicitly set to null
|
||||||
|
// +optional
|
||||||
|
AdditionalPrinterColumns []CustomResourceColumnDefinition
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomResourceColumnDefinition specifies a column for server side printing.
|
// CustomResourceColumnDefinition specifies a column for server side printing.
|
||||||
|
@ -47,9 +47,13 @@ type CustomResourceDefinitionSpec struct {
|
|||||||
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
|
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
|
||||||
Scope ResourceScope `json:"scope" protobuf:"bytes,4,opt,name=scope,casttype=ResourceScope"`
|
Scope ResourceScope `json:"scope" protobuf:"bytes,4,opt,name=scope,casttype=ResourceScope"`
|
||||||
// Validation describes the validation methods for CustomResources
|
// Validation describes the validation methods for CustomResources
|
||||||
|
// Optional, the global validation schema for all versions.
|
||||||
|
// Top-level and per-version schemas are mutually exclusive.
|
||||||
// +optional
|
// +optional
|
||||||
Validation *CustomResourceValidation `json:"validation,omitempty" protobuf:"bytes,5,opt,name=validation"`
|
Validation *CustomResourceValidation `json:"validation,omitempty" protobuf:"bytes,5,opt,name=validation"`
|
||||||
// Subresources describes the subresources for CustomResources
|
// Subresources describes the subresources for CustomResource
|
||||||
|
// Optional, the global subresources for all versions.
|
||||||
|
// Top-level and per-version subresources are mutually exclusive.
|
||||||
// +optional
|
// +optional
|
||||||
Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,6,opt,name=subresources"`
|
Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,6,opt,name=subresources"`
|
||||||
// Versions is the list of all supported versions for this resource.
|
// Versions is the list of all supported versions for this resource.
|
||||||
@ -66,6 +70,8 @@ type CustomResourceDefinitionSpec struct {
|
|||||||
// +optional
|
// +optional
|
||||||
Versions []CustomResourceDefinitionVersion `json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"`
|
Versions []CustomResourceDefinitionVersion `json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"`
|
||||||
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
||||||
|
// Optional, the global columns for all versions.
|
||||||
|
// Top-level and per-version columns are mutually exclusive.
|
||||||
// +optional
|
// +optional
|
||||||
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,8,rep,name=additionalPrinterColumns"`
|
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,8,rep,name=additionalPrinterColumns"`
|
||||||
|
|
||||||
@ -159,6 +165,27 @@ type CustomResourceDefinitionVersion struct {
|
|||||||
// Storage flags the version as storage version. There must be exactly one
|
// Storage flags the version as storage version. There must be exactly one
|
||||||
// flagged as storage version.
|
// flagged as storage version.
|
||||||
Storage bool `json:"storage" protobuf:"varint,3,opt,name=storage"`
|
Storage bool `json:"storage" protobuf:"varint,3,opt,name=storage"`
|
||||||
|
// Schema describes the schema for CustomResource used in validation, pruning, and defaulting.
|
||||||
|
// Top-level and per-version schemas are mutually exclusive.
|
||||||
|
// Per-version schemas must not all be set to identical values (top-level validation schema should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// +optional
|
||||||
|
Schema *CustomResourceValidation `json:"schema,omitempty" protobuf:"bytes,4,opt,name=schema"`
|
||||||
|
// Subresources describes the subresources for CustomResource
|
||||||
|
// Top-level and per-version subresources are mutually exclusive.
|
||||||
|
// Per-version subresources must not all be set to identical values (top-level subresources should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// +optional
|
||||||
|
Subresources *CustomResourceSubresources `json:"subresources,omitempty" protobuf:"bytes,5,opt,name=subresources"`
|
||||||
|
// AdditionalPrinterColumns are additional columns shown e.g. in kubectl next to the name. Defaults to a created-at column.
|
||||||
|
// Top-level and per-version columns are mutually exclusive.
|
||||||
|
// Per-version columns must not all be set to identical values (top-level columns should be used instead)
|
||||||
|
// This field is alpha-level and is only honored by servers that enable the CustomResourceWebhookConversion feature.
|
||||||
|
// NOTE: CRDs created prior to 1.13 populated the top-level additionalPrinterColumns field by default. To apply an
|
||||||
|
// update that changes to per-version additionalPrinterColumns, the top-level additionalPrinterColumns field must
|
||||||
|
// be explicitly set to null
|
||||||
|
// +optional
|
||||||
|
AdditionalPrinterColumns []CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty" protobuf:"bytes,6,rep,name=additionalPrinterColumns"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomResourceColumnDefinition specifies a column for server side printing.
|
// CustomResourceColumnDefinition specifies a column for server side printing.
|
||||||
|
@ -41,7 +41,7 @@ const (
|
|||||||
// CustomResourceSubresources defines the subresources for CustomResources
|
// CustomResourceSubresources defines the subresources for CustomResources
|
||||||
CustomResourceSubresources utilfeature.Feature = "CustomResourceSubresources"
|
CustomResourceSubresources utilfeature.Feature = "CustomResourceSubresources"
|
||||||
|
|
||||||
// owner: @mbohlool
|
// owner: @mbohlool, @roycaihw
|
||||||
// alpha: v1.13
|
// alpha: v1.13
|
||||||
//
|
//
|
||||||
// CustomResourceWebhookConversion defines the webhook conversion for Custom Resources.
|
// CustomResourceWebhookConversion defines the webhook conversion for Custom Resources.
|
||||||
|
Loading…
Reference in New Issue
Block a user