diff --git a/config/v1/register.go b/config/v1/register.go index e096d9e3134..66c342569aa 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{}, + &FeatureGate{}, + &FeatureGateList{}, &Image{}, &ImageList{}, &Infrastructure{}, diff --git a/config/v1/types_features.go b/config/v1/types_feature.go similarity index 79% rename from config/v1/types_features.go rename to config/v1/types_feature.go index 0cc54890cf2..df4e6a61580 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 FeatureGate 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 FeatureGateSpec `json:"spec"` // status holds observed values from the cluster. They may not be overridden. // +optional - Status FeaturesStatus `json:"status"` + Status FeatureGateStatus `json:"status"` } type FeatureSet string @@ -31,30 +31,30 @@ var ( TechPreviewNoUpgrade FeatureSet = "TechPreviewNoUpgrade" ) -type FeaturesSpec struct { +type FeatureGateSpec 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 FeatureGateStatus struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type FeaturesList struct { +type FeatureGateList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. metav1.ListMeta `json:"metadata"` - Items []Features `json:"items"` + Items []FeatureGate `json:"items"` } -type FeatureEnabledDisabled struct { +type FeatureGateEnabledDisabled struct { Enabled []string 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,11 +62,11 @@ 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 { } // // If you put an item in either of these lists, put your area and name on it so we can find owners. -var FeatureSets = map[FeatureSet]*FeatureEnabledDisabled{ - Default: &FeatureEnabledDisabled{ +var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ + Default: &FeatureGateEnabledDisabled{ Enabled: []string{ "ExperimentalCriticalPodAnnotation", // sig-pod, sjenning "RotateKubeletServerCertificate", // sig-pod, sjenning @@ -76,7 +76,7 @@ var FeatureSets = map[FeatureSet]*FeatureEnabledDisabled{ "PersistentLocalVolumes", // sig-storage, hekumar@redhat.com }, }, - TechPreviewNoUpgrade: &FeatureEnabledDisabled{ + TechPreviewNoUpgrade: &FeatureGateEnabledDisabled{ Enabled: []string{ "ExperimentalCriticalPodAnnotation", // sig-pod, sjenning "RotateKubeletServerCertificate", // sig-pod, sjenning diff --git a/config/v1/zz_generated.deepcopy.go b/config/v1/zz_generated.deepcopy.go index a3be0e654fb..54f6273efb1 100644 --- a/config/v1/zz_generated.deepcopy.go +++ b/config/v1/zz_generated.deepcopy.go @@ -1164,67 +1164,67 @@ func (in *EtcdStorageConfig) DeepCopy() *EtcdStorageConfig { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeatureEnabledDisabled) DeepCopyInto(out *FeatureEnabledDisabled) { +func (in *FeatureGate) DeepCopyInto(out *FeatureGate) { *out = *in - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Disabled != nil { - in, out := &in.Disabled, &out.Disabled - *out = make([]string, len(*in)) - copy(*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 FeatureEnabledDisabled. -func (in *FeatureEnabledDisabled) DeepCopy() *FeatureEnabledDisabled { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureGate. +func (in *FeatureGate) DeepCopy() *FeatureGate { if in == nil { return nil } - out := new(FeatureEnabledDisabled) + out := new(FeatureGate) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureGate) 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 *Features) DeepCopyInto(out *Features) { +func (in *FeatureGateEnabledDisabled) DeepCopyInto(out *FeatureGateEnabledDisabled) { *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = make([]string, len(*in)) + copy(*out, *in) + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Features. -func (in *Features) DeepCopy() *Features { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureGateEnabledDisabled. +func (in *FeatureGateEnabledDisabled) DeepCopy() *FeatureGateEnabledDisabled { if in == nil { return nil } - out := new(Features) + out := new(FeatureGateEnabledDisabled) 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 *FeatureGateList) DeepCopyInto(out *FeatureGateList) { *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([]FeatureGate, 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 FeatureGateList. +func (in *FeatureGateList) DeepCopy() *FeatureGateList { if in == nil { return nil } - out := new(FeaturesList) + out := new(FeatureGateList) 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 *FeatureGateList) 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 *FeatureGateSpec) DeepCopyInto(out *FeatureGateSpec) { *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 FeatureGateSpec. +func (in *FeatureGateSpec) DeepCopy() *FeatureGateSpec { if in == nil { return nil } - out := new(FeaturesSpec) + out := new(FeatureGateSpec) 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 *FeatureGateStatus) DeepCopyInto(out *FeatureGateStatus) { *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 FeatureGateStatus. +func (in *FeatureGateStatus) DeepCopy() *FeatureGateStatus { if in == nil { return nil } - out := new(FeaturesStatus) + out := new(FeatureGateStatus) 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..27613f37f67 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_FeatureGate = 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 (FeatureGate) SwaggerDoc() map[string]string { + return map_FeatureGate } -var map_FeaturesList = map[string]string{ +var map_FeatureGateList = map[string]string{ "metadata": "Standard object's metadata.", } -func (FeaturesList) SwaggerDoc() map[string]string { - return map_FeaturesList +func (FeatureGateList) SwaggerDoc() map[string]string { + return map_FeatureGateList } -var map_FeaturesSpec = map[string]string{ +var map_FeatureGateSpec = 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 (FeatureGateSpec) SwaggerDoc() map[string]string { + return map_FeatureGateSpec } var map_Image = map[string]string{