diff --git a/operator/v1/types.go b/operator/v1/types.go index 380705bddb3..d0eb81189f2 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -1,9 +1,8 @@ package v1 import ( - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" ) // MyOperatorResource is an example operator configuration type @@ -59,10 +58,6 @@ type OperatorSpec struct { // +optional OperatorLogLevel LogLevel `json:"operatorLogLevel"` - // operandSpecs provide customization for functional units within the component - // +optional - OperandSpecs []OperandSpec `json:"operandSpecs,omitempty"` - // unsupportedConfigOverrides holds a sparse config that will override any previously set options. It only needs to be the fields to override // it will end up overlaying in the following order: // 1. hardcoded defaults @@ -96,38 +91,6 @@ var ( TraceAll LogLevel = "TraceAll" ) -// ResourcePatch is a way to represent the patch you would issue to `kubectl patch` in the API -type ResourcePatch struct { - // type is the type of patch to apply: jsonmerge, strategicmerge - Type string `json:"type"` - // patch the patch itself - Patch string `json:"patch"` -} - -// OperandSpec holds information for customization of a particular functional unit - logically maps to a workload -type OperandSpec struct { - // name is the name of this unit. The operator must be aware of it. - Name string `json:"name"` - - // operandContainerSpecs are per-container options - // +optional - OperandContainerSpecs []OperandContainerSpec `json:"operandContainerSpecs,omitempty"` - - // unsupportedResourcePatches are applied to the workload resource for this unit. This is an unsupported - // workaround if anything needs to be modified on the workload that is not otherwise configurable. - // TODO Decide: alternatively, we could simply include a RawExtension which is used in place of the "normal" default manifest - // +optional - UnsupportedResourcePatches []ResourcePatch `json:"unsupportedResourcePatches,omitempty"` -} - -type OperandContainerSpec struct { - // name is the name of the container to modify - Name string `json:"name"` - - // resources are the requests and limits to place in the container. Nil means to accept the defaults. - Resources *corev1.ResourceRequirements `json:"resources,omitempty"` -} - type OperatorStatus struct { // observedGeneration is the last generation change you've dealt with // +optional @@ -200,6 +163,11 @@ const ( type StaticPodOperatorSpec struct { OperatorSpec `json:",inline"` + // forceRedeploymentReason can be used to force the redeployment of the operand by providing a unique string. + // This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work + // this time instead of failing again on the same config. + ForceRedeploymentReason string `json:"forceRedeploymentReason"` + // failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api // -1 = unlimited, 0 or unset = 5 (default) FailedRevisionLimit int32 `json:"failedRevisionLimit,omitempty"` diff --git a/operator/v1/types_kubeapiserver.go b/operator/v1/types_kubeapiserver.go index d0d14f3cc56..6b79a8e0c61 100644 --- a/operator/v1/types_kubeapiserver.go +++ b/operator/v1/types_kubeapiserver.go @@ -14,18 +14,13 @@ type KubeAPIServer struct { metav1.ObjectMeta `json:"metadata"` // +required - Spec KubeAPIServerSpec `json:"spec"` + Spec KubeAPIServerSpec `json:"spec"` // +optional Status KubeAPIServerStatus `json:"status"` } type KubeAPIServerSpec struct { StaticPodOperatorSpec `json:",inline"` - - // forceRedeploymentReason can be used to force the redeployment of the kube-apiserver by providing a unique string. - // This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work - // this time instead of failing again on the same config. - ForceRedeploymentReason string `json:"forceRedeploymentReason"` } type KubeAPIServerStatus struct { diff --git a/operator/v1/types_kubecontrollermanager.go b/operator/v1/types_kubecontrollermanager.go index 564be1ac09d..36ecc5edade 100644 --- a/operator/v1/types_kubecontrollermanager.go +++ b/operator/v1/types_kubecontrollermanager.go @@ -14,18 +14,13 @@ type KubeControllerManager struct { metav1.ObjectMeta `json:"metadata"` // +required - Spec KubeControllerManagerSpec `json:"spec"` + Spec KubeControllerManagerSpec `json:"spec"` // +optional Status KubeControllerManagerStatus `json:"status"` } type KubeControllerManagerSpec struct { StaticPodOperatorSpec `json:",inline"` - - // forceRedeploymentReason can be used to force the redeployment of the kube-controller-manager by providing a unique string. - // This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work - // this time instead of failing again on the same config. - ForceRedeploymentReason string `json:"forceRedeploymentReason"` } type KubeControllerManagerStatus struct { diff --git a/operator/v1/types_scheduler.go b/operator/v1/types_scheduler.go index 0d08b804445..69fa5fbe4ce 100644 --- a/operator/v1/types_scheduler.go +++ b/operator/v1/types_scheduler.go @@ -14,18 +14,13 @@ type KubeScheduler struct { metav1.ObjectMeta `json:"metadata"` // +required - Spec KubeSchedulerSpec `json:"spec"` + Spec KubeSchedulerSpec `json:"spec"` // +optional Status KubeSchedulerStatus `json:"status"` } type KubeSchedulerSpec struct { StaticPodOperatorSpec `json:",inline"` - - // forceRedeploymentReason can be used to force the redeployment of the kube-scheduler by providing a unique string. - // This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work - // this time instead of failing again on the same config. - ForceRedeploymentReason string `json:"forceRedeploymentReason"` } type KubeSchedulerStatus struct { diff --git a/operator/v1/zz_generated.deepcopy.go b/operator/v1/zz_generated.deepcopy.go index 66087d3dd52..8974078f615 100644 --- a/operator/v1/zz_generated.deepcopy.go +++ b/operator/v1/zz_generated.deepcopy.go @@ -1391,55 +1391,6 @@ func (in *OpenShiftSDNConfig) DeepCopy() *OpenShiftSDNConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OperandContainerSpec) DeepCopyInto(out *OperandContainerSpec) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = new(corev1.ResourceRequirements) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperandContainerSpec. -func (in *OperandContainerSpec) DeepCopy() *OperandContainerSpec { - if in == nil { - return nil - } - out := new(OperandContainerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OperandSpec) DeepCopyInto(out *OperandSpec) { - *out = *in - if in.OperandContainerSpecs != nil { - in, out := &in.OperandContainerSpecs, &out.OperandContainerSpecs - *out = make([]OperandContainerSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.UnsupportedResourcePatches != nil { - in, out := &in.UnsupportedResourcePatches, &out.UnsupportedResourcePatches - *out = make([]ResourcePatch, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperandSpec. -func (in *OperandSpec) DeepCopy() *OperandSpec { - if in == nil { - return nil - } - out := new(OperandSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OperatorCondition) DeepCopyInto(out *OperatorCondition) { *out = *in @@ -1460,13 +1411,6 @@ func (in *OperatorCondition) DeepCopy() *OperatorCondition { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OperatorSpec) DeepCopyInto(out *OperatorSpec) { *out = *in - if in.OperandSpecs != nil { - in, out := &in.OperandSpecs, &out.OperandSpecs - *out = make([]OperandSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } in.UnsupportedConfigOverrides.DeepCopyInto(&out.UnsupportedConfigOverrides) in.ObservedConfig.DeepCopyInto(&out.ObservedConfig) return @@ -1541,22 +1485,6 @@ func (in *ProxyConfig) DeepCopy() *ProxyConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourcePatch) DeepCopyInto(out *ResourcePatch) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePatch. -func (in *ResourcePatch) DeepCopy() *ResourcePatch { - if in == nil { - return nil - } - out := new(ResourcePatch) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServiceCA) DeepCopyInto(out *ServiceCA) { *out = *in diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 679c39816eb..28d906da56c 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -46,26 +46,6 @@ func (NodeStatus) SwaggerDoc() map[string]string { return map_NodeStatus } -var map_OperandContainerSpec = map[string]string{ - "name": "name is the name of the container to modify", - "resources": "resources are the requests and limits to place in the container. Nil means to accept the defaults.", -} - -func (OperandContainerSpec) SwaggerDoc() map[string]string { - return map_OperandContainerSpec -} - -var map_OperandSpec = map[string]string{ - "": "OperandSpec holds information for customization of a particular functional unit - logically maps to a workload", - "name": "name is the name of this unit. The operator must be aware of it.", - "operandContainerSpecs": "operandContainerSpecs are per-container options", - "unsupportedResourcePatches": "unsupportedResourcePatches are applied to the workload resource for this unit. This is an unsupported workaround if anything needs to be modified on the workload that is not otherwise configurable.", -} - -func (OperandSpec) SwaggerDoc() map[string]string { - return map_OperandSpec -} - var map_OperatorCondition = map[string]string{ "": "OperatorCondition is just the standard condition fields.", } @@ -79,7 +59,6 @@ var map_OperatorSpec = map[string]string{ "managementState": "managementState indicates whether and how the operator should manage the component", "logLevel": "logLevel is an intent based logging for an overall component. It does not give fine grained control, but it is a simple way to manage coarse grained logging choices that operators have to interpret for their operands.", "operatorLogLevel": "operatorLogLevel is an intent based logging for the operator itself. It does not give fine grained control, but it is a simple way to manage coarse grained logging choices that operators have to interpret for themselves.", - "operandSpecs": "operandSpecs provide customization for functional units within the component", "unsupportedConfigOverrides": "unsupportedConfigOverrides holds a sparse config that will override any previously set options. It only needs to be the fields to override it will end up overlaying in the following order: 1. hardcoded defaults 2. observedConfig 3. unsupportedConfigOverrides", "observedConfig": "observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because it is an input to the level for the operator", } @@ -100,20 +79,11 @@ func (OperatorStatus) SwaggerDoc() map[string]string { return map_OperatorStatus } -var map_ResourcePatch = map[string]string{ - "": "ResourcePatch is a way to represent the patch you would issue to `kubectl patch` in the API", - "type": "type is the type of patch to apply: jsonmerge, strategicmerge", - "patch": "patch the patch itself", -} - -func (ResourcePatch) SwaggerDoc() map[string]string { - return map_ResourcePatch -} - var map_StaticPodOperatorSpec = map[string]string{ "": "StaticPodOperatorSpec is spec for controllers that manage static pods.", - "failedRevisionLimit": "failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", - "succeededRevisionLimit": "succeededRevisionLimit is the number of successful static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", + "forceRedeploymentReason": "forceRedeploymentReason can be used to force the redeployment of the operand by providing a unique string. This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work this time instead of failing again on the same config.", + "failedRevisionLimit": "failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", + "succeededRevisionLimit": "succeededRevisionLimit is the number of successful static pod installer revisions to keep on disk and in the api -1 = unlimited, 0 or unset = 5 (default)", } func (StaticPodOperatorSpec) SwaggerDoc() map[string]string { @@ -309,14 +279,6 @@ func (KubeAPIServerList) SwaggerDoc() map[string]string { return map_KubeAPIServerList } -var map_KubeAPIServerSpec = map[string]string{ - "forceRedeploymentReason": "forceRedeploymentReason can be used to force the redeployment of the kube-apiserver by providing a unique string. This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work this time instead of failing again on the same config.", -} - -func (KubeAPIServerSpec) SwaggerDoc() map[string]string { - return map_KubeAPIServerSpec -} - var map_KubeControllerManager = map[string]string{ "": "KubeControllerManager provides information to configure an operator to manage kube-controller-manager.", } @@ -335,14 +297,6 @@ func (KubeControllerManagerList) SwaggerDoc() map[string]string { return map_KubeControllerManagerList } -var map_KubeControllerManagerSpec = map[string]string{ - "forceRedeploymentReason": "forceRedeploymentReason can be used to force the redeployment of the kube-controller-manager by providing a unique string. This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work this time instead of failing again on the same config.", -} - -func (KubeControllerManagerSpec) SwaggerDoc() map[string]string { - return map_KubeControllerManagerSpec -} - var map_AdditionalNetworkDefinition = map[string]string{ "": "AdditionalNetworkDefinition configures an extra network that is available but not created by default. Instead, pods must request them by name. type must be specified, along with exactly one \"Config\" that matches the type.", "type": "type is the type of network The only supported value is NetworkTypeRaw", @@ -498,14 +452,6 @@ func (KubeSchedulerList) SwaggerDoc() map[string]string { return map_KubeSchedulerList } -var map_KubeSchedulerSpec = map[string]string{ - "forceRedeploymentReason": "forceRedeploymentReason can be used to force the redeployment of the kube-scheduler by providing a unique string. This provides a mechanism to kick a previously failed deployment and provide a reason why you think it will work this time instead of failing again on the same config.", -} - -func (KubeSchedulerSpec) SwaggerDoc() map[string]string { - return map_KubeSchedulerSpec -} - var map_ServiceCA = map[string]string{ "": "ServiceCA provides information to configure an operator to manage the service cert controllers", "spec": "spec holds user settable values for configuration",