Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e5587f52
Commit
e5587f52
authored
Nov 07, 2018
by
Haowei Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature gate and API changes for multi-version
schema, subresources and columns
parent
7e102de7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
3 deletions
+60
-3
types.go
...o/apiextensions-apiserver/pkg/apis/apiextensions/types.go
+31
-1
types.go
...ensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
+28
-1
kube_features.go
....io/apiextensions-apiserver/pkg/features/kube_features.go
+1
-1
No files found.
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go
View file @
e5587f52
...
@@ -44,8 +44,14 @@ type CustomResourceDefinitionSpec struct {
...
@@ -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 {
...
@@ -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 {
...
@@ -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.
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
View file @
e5587f52
...
@@ -47,9 +47,13 @@ type CustomResourceDefinitionSpec struct {
...
@@ -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 {
...
@@ -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 {
...
@@ -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.
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go
View file @
e5587f52
...
@@ -41,7 +41,7 @@ const (
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment