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
10c48ae5
Commit
10c48ae5
authored
Apr 18, 2018
by
Mehdy Bohlool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRD versioning - types change
parent
10b8665a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletion
+66
-1
types.go
...o/apiextensions-apiserver/pkg/apis/apiextensions/types.go
+32
-0
types.go
...ensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
+34
-1
No files found.
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/types.go
View file @
10c48ae5
...
...
@@ -25,6 +25,9 @@ type CustomResourceDefinitionSpec struct {
// Group is the group this resource belongs in
Group
string
// Version is the version this resource belongs in
// Should be always first item in Versions field if provided.
// Optional, but at least one of Version or Versions must be set.
// Deprecated: Please use `Versions`.
Version
string
// Names are the names used to describe this custom resource
Names
CustomResourceDefinitionNames
...
...
@@ -34,6 +37,27 @@ type CustomResourceDefinitionSpec struct {
Validation
*
CustomResourceValidation
// Subresources describes the subresources for CustomResources
Subresources
*
CustomResourceSubresources
// Versions is the list of all supported versions for this resource.
// If Version field is provided, this field is optional.
// Validation: All versions must use the same validation schema for now. i.e., top
// level Validation field is applied to all of these versions.
// Order: The version name will be used to compute the order.
// If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered
// lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version),
// then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first
// by GA > beta > alpha, and then by comparing major version, then minor version. An example sorted list of
// versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
Versions
[]
CustomResourceDefinitionVersion
}
type
CustomResourceDefinitionVersion
struct
{
// Name is the version name, e.g. “v1”, “v2beta1”, etc.
Name
string
// Served is a flag enabling/disabling this version from being served via REST APIs
Served
bool
// Storage flags the version as storage version. There must be exactly one flagged
// as storage version.
Storage
bool
}
// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
...
...
@@ -115,6 +139,14 @@ type CustomResourceDefinitionStatus struct {
// AcceptedNames are the names that are actually being used to serve discovery
// They may be different than the names in spec.
AcceptedNames
CustomResourceDefinitionNames
// StoredVersions are all versions of CustomResources that were ever persisted. Tracking these
// versions allows a migration path for stored versions in etcd. The field is mutable
// so the migration controller can first finish a migration to another version (i.e.
// that no old objects are left in the storage), and then remove the rest of the
// versions from this list.
// None of the versions in this list can be removed from the spec.Versions field.
StoredVersions
[]
string
}
// CustomResourceCleanupFinalizer is the name of the finalizer which will delete instances of
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/types.go
View file @
10c48ae5
...
...
@@ -25,7 +25,11 @@ type CustomResourceDefinitionSpec struct {
// Group is the group this resource belongs in
Group
string
`json:"group" protobuf:"bytes,1,opt,name=group"`
// Version is the version this resource belongs in
Version
string
`json:"version" protobuf:"bytes,2,opt,name=version"`
// Should be always first item in Versions field if provided.
// Optional, but at least one of Version or Versions must be set.
// Deprecated: Please use `Versions`.
// +optional
Version
string
`json:"version,omitempty" protobuf:"bytes,2,opt,name=version"`
// Names are the names used to describe this custom resource
Names
CustomResourceDefinitionNames
`json:"names" protobuf:"bytes,3,opt,name=names"`
// Scope indicates whether this resource is cluster or namespace scoped. Default is namespaced
...
...
@@ -36,6 +40,27 @@ type CustomResourceDefinitionSpec struct {
// Subresources describes the subresources for CustomResources
// +optional
Subresources
*
CustomResourceSubresources
`json:"subresources,omitempty" protobuf:"bytes,6,opt,name=subresources"`
// Versions is the list of all supported versions for this resource.
// If Version field is provided, this field is optional.
// Validation: All versions must use the same validation schema for now. i.e., top
// level Validation field is applied to all of these versions.
// Order: The version name will be used to compute the order.
// If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered
// lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version),
// then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first
// by GA > beta > alpha, and then by comparing major version, then minor version. An example sorted list of
// versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
Versions
[]
CustomResourceDefinitionVersion
`json:"versions,omitempty" protobuf:"bytes,7,rep,name=versions"`
}
type
CustomResourceDefinitionVersion
struct
{
// Name is the version name, e.g. “v1”, “v2beta1”, etc.
Name
string
`json:"name" protobuf:"bytes,1,opt,name=name"`
// Served is a flag enabling/disabling this version from being served via REST APIs
Served
bool
`json:"served" protobuf:"varint,2,opt,name=served"`
// Storage flags the version as storage version. There must be exactly one
// flagged as storage version.
Storage
bool
`json:"storage" protobuf:"varint,3,opt,name=storage"`
}
// CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
...
...
@@ -117,6 +142,14 @@ type CustomResourceDefinitionStatus struct {
// AcceptedNames are the names that are actually being used to serve discovery
// They may be different than the names in spec.
AcceptedNames
CustomResourceDefinitionNames
`json:"acceptedNames" protobuf:"bytes,2,opt,name=acceptedNames"`
// StoredVersions are all versions of CustomResources that were ever persisted. Tracking these
// versions allows a migration path for stored versions in etcd. The field is mutable
// so the migration controller can first finish a migration to another version (i.e.
// that no old objects are left in the storage), and then remove the rest of the
// versions from this list.
// None of the versions in this list can be removed from the spec.Versions field.
StoredVersions
[]
string
`json:"storedVersions" protobuf:"bytes,3,rep,name=storedVersions"`
}
// CustomResourceCleanupFinalizer is the name of the finalizer which will delete instances of
...
...
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