diff --git a/config/v1/register.go b/config/v1/register.go index e096d9e3134..78b84b53d61 100644 --- a/config/v1/register.go +++ b/config/v1/register.go @@ -44,8 +44,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ConsoleList{}, &DNS{}, &DNSList{}, - &Features{}, - &FeaturesList{}, + &Feature{}, + &FeatureList{}, &Image{}, &ImageList{}, &Infrastructure{}, diff --git a/config/v1/types_features.go b/config/v1/types_feature.go similarity index 83% rename from config/v1/types_features.go rename to config/v1/types_feature.go index c55db6d5f43..67b5ec17ea3 100644 --- a/config/v1/types_features.go +++ b/config/v1/types_feature.go @@ -6,18 +6,18 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// Features holds cluster-wide information about feature gates. The canonical name is `cluster` -type Features struct { +// Feature holds cluster-wide information about feature gates. The canonical name is `cluster` +type Feature struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. metav1.ObjectMeta `json:"metadata,omitempty"` // spec holds user settable values for configuration // +required - Spec FeaturesSpec `json:"spec"` + Spec FeatureSpec `json:"spec"` // status holds observed values from the cluster. They may not be overridden. // +optional - Status FeaturesStatus `json:"status"` + Status FeatureStatus `json:"status"` } type FeatureSet string @@ -31,22 +31,22 @@ var ( TechPreviewNoUpgrade FeatureSet = "TechPreviewNoUpgrade" ) -type FeaturesSpec struct { +type FeatureSpec struct { // featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. // Turning on or off features may cause irreversible changes in your cluster which cannot be undone. FeatureSet FeatureSet `json:"featureSet,omitempty"` } -type FeaturesStatus struct { +type FeatureStatus struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type FeaturesList struct { +type FeatureList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. metav1.ListMeta `json:"metadata"` - Items []Features `json:"items"` + Items []Feature `json:"items"` } type FeatureEnabledDisabled struct { @@ -54,7 +54,7 @@ type FeatureEnabledDisabled struct { Disabled []string } -// FeatureSets Contains a map of Feature names to Enabled/Disabled Features. +// FeatureSets Contains a map of Feature names to Enabled/Disabled Feature. // // NOTE: The caller needs to make sure to check for the existence of the value // using golang's existence field. A possible scenario is an upgrade where new @@ -62,7 +62,7 @@ type FeatureEnabledDisabled struct { // version of this file. In this upgrade scenario the map could return nil. // // example: -// if featureSet, ok := FeaturesSets["SomeNewFeature"]; ok { } +// if featureSet, ok := FeatureSets["SomeNewFeature"]; ok { } // var FeatureSets = map[FeatureSet]*FeatureEnabledDisabled{ Default: &FeatureEnabledDisabled{ diff --git a/config/v1/zz_generated.deepcopy.go b/config/v1/zz_generated.deepcopy.go index a3be0e654fb..ebe7bec73c1 100644 --- a/config/v1/zz_generated.deepcopy.go +++ b/config/v1/zz_generated.deepcopy.go @@ -1163,6 +1163,34 @@ func (in *EtcdStorageConfig) DeepCopy() *EtcdStorageConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Feature) DeepCopyInto(out *Feature) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Feature. +func (in *Feature) DeepCopy() *Feature { + if in == nil { + return nil + } + out := new(Feature) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Feature) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FeatureEnabledDisabled) DeepCopyInto(out *FeatureEnabledDisabled) { *out = *in @@ -1190,41 +1218,13 @@ func (in *FeatureEnabledDisabled) DeepCopy() *FeatureEnabledDisabled { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Features) DeepCopyInto(out *Features) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Features. -func (in *Features) DeepCopy() *Features { - if in == nil { - return nil - } - out := new(Features) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Features) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesList) DeepCopyInto(out *FeaturesList) { +func (in *FeatureList) DeepCopyInto(out *FeatureList) { *out = *in out.TypeMeta = in.TypeMeta out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]Features, len(*in)) + *out = make([]Feature, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1232,18 +1232,18 @@ func (in *FeaturesList) DeepCopyInto(out *FeaturesList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesList. -func (in *FeaturesList) DeepCopy() *FeaturesList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureList. +func (in *FeatureList) DeepCopy() *FeatureList { if in == nil { return nil } - out := new(FeaturesList) + out := new(FeatureList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FeaturesList) DeepCopyObject() runtime.Object { +func (in *FeatureList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -1251,33 +1251,33 @@ func (in *FeaturesList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesSpec) DeepCopyInto(out *FeaturesSpec) { +func (in *FeatureSpec) DeepCopyInto(out *FeatureSpec) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesSpec. -func (in *FeaturesSpec) DeepCopy() *FeaturesSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureSpec. +func (in *FeatureSpec) DeepCopy() *FeatureSpec { if in == nil { return nil } - out := new(FeaturesSpec) + out := new(FeatureSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeaturesStatus) DeepCopyInto(out *FeaturesStatus) { +func (in *FeatureStatus) DeepCopyInto(out *FeatureStatus) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturesStatus. -func (in *FeaturesStatus) DeepCopy() *FeaturesStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureStatus. +func (in *FeatureStatus) DeepCopy() *FeatureStatus { if in == nil { return nil } - out := new(FeaturesStatus) + out := new(FeatureStatus) in.DeepCopyInto(out) return out } diff --git a/config/v1/zz_generated.swagger_doc_generated.go b/config/v1/zz_generated.swagger_doc_generated.go index 1545e4e2b49..ceed7e94dc6 100644 --- a/config/v1/zz_generated.swagger_doc_generated.go +++ b/config/v1/zz_generated.swagger_doc_generated.go @@ -610,31 +610,31 @@ func (DNSZone) SwaggerDoc() map[string]string { return map_DNSZone } -var map_Features = map[string]string{ - "": "Features holds cluster-wide information about feature gates. The canonical name is `cluster`", +var map_Feature = map[string]string{ + "": "Feature holds cluster-wide information about feature gates. The canonical name is `cluster`", "metadata": "Standard object's metadata.", "spec": "spec holds user settable values for configuration", "status": "status holds observed values from the cluster. They may not be overridden.", } -func (Features) SwaggerDoc() map[string]string { - return map_Features +func (Feature) SwaggerDoc() map[string]string { + return map_Feature } -var map_FeaturesList = map[string]string{ +var map_FeatureList = map[string]string{ "metadata": "Standard object's metadata.", } -func (FeaturesList) SwaggerDoc() map[string]string { - return map_FeaturesList +func (FeatureList) SwaggerDoc() map[string]string { + return map_FeatureList } -var map_FeaturesSpec = map[string]string{ +var map_FeatureSpec = map[string]string{ "featureSet": "featureSet changes the list of features in the cluster. The default is empty. Be very careful adjusting this setting. Turning on or off features may cause irreversible changes in your cluster which cannot be undone.", } -func (FeaturesSpec) SwaggerDoc() map[string]string { - return map_FeaturesSpec +func (FeatureSpec) SwaggerDoc() map[string]string { + return map_FeatureSpec } var map_Image = map[string]string{