diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 2d377e7b234..82e7c317187 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -52685,15 +52685,14 @@ func schema_openshift_api_operator_v1_NodeStatus(ref common.ReferenceCallback) c }, "currentRevision": { SchemaProps: spec.SchemaProps{ - Description: "currentRevision is the generation of the most recently successful deployment", - Default: 0, + Description: "currentRevision is the generation of the most recently successful deployment. Can not be set on creation of a nodeStatus. Updates must only increase the value.", Type: []string{"integer"}, Format: "int32", }, }, "targetRevision": { SchemaProps: spec.SchemaProps{ - Description: "targetRevision is the generation of the deployment we're trying to apply", + Description: "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", Type: []string{"integer"}, Format: "int32", }, @@ -52753,7 +52752,7 @@ func schema_openshift_api_operator_v1_NodeStatus(ref common.ReferenceCallback) c }, }, }, - Required: []string{"nodeName", "currentRevision"}, + Required: []string{"nodeName"}, }, }, Dependencies: []string{ diff --git a/openapi/openapi.json b/openapi/openapi.json index a4b5038e2a0..596e510f308 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -30736,15 +30736,13 @@ "description": "NodeStatus provides information about the current state of a particular node managed by this operator.", "type": "object", "required": [ - "nodeName", - "currentRevision" + "nodeName" ], "properties": { "currentRevision": { - "description": "currentRevision is the generation of the most recently successful deployment", + "description": "currentRevision is the generation of the most recently successful deployment. Can not be set on creation of a nodeStatus. Updates must only increase the value.", "type": "integer", - "format": "int32", - "default": 0 + "format": "int32" }, "lastFailedCount": { "description": "lastFailedCount is how often the installer pod of the last failed revision failed.", @@ -30784,7 +30782,7 @@ "default": "" }, "targetRevision": { - "description": "targetRevision is the generation of the deployment we're trying to apply", + "description": "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", "type": "integer", "format": "int32" } diff --git a/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml b/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml index f0b8c4daa85..7589d4d2bae 100644 --- a/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml @@ -16,6 +16,9 @@ tests: operatorLogLevel: Normal onUpdate: - name: Should reject multiple nodes with nonzero target revisions + initialCRDPatches: + - op: remove + path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/nodeStatuses/items/x-kubernetes-validations/2 initial: | apiVersion: operator.openshift.io/v1 kind: KubeAPIServer @@ -23,7 +26,7 @@ tests: status: nodeStatuses: - nodeName: a - targetRevision: 1 + targetRevision: 0 - nodeName: b targetRevision: 0 - nodeName: c @@ -43,6 +46,9 @@ tests: - nodeName: d expectedStatusError: "status.nodeStatuses: Invalid value: \"array\": no more than 1 node status may have a nonzero targetRevision" - name: Should reject decreasing currentRevision + initialCRDPatches: + - op: remove + path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/nodeStatuses/items/x-kubernetes-validations/1 initial: | apiVersion: operator.openshift.io/v1 kind: KubeAPIServer @@ -61,6 +67,9 @@ tests: currentRevision: 2 expectedStatusError: "status.nodeStatuses[0].currentRevision: Invalid value: \"integer\": must only increase" - name: Should reject clearing currentRevision + initialCRDPatches: + - op: remove + path: /spec/versions/0/schema/openAPIV3Schema/properties/status/properties/nodeStatuses/items/x-kubernetes-validations/1 initial: | apiVersion: operator.openshift.io/v1 kind: KubeAPIServer @@ -77,3 +86,113 @@ tests: nodeStatuses: - nodeName: a expectedStatusError: "status.nodeStatuses[0].currentRevision: Invalid value: \"object\": cannot be unset once set" + - name: Should reject setting new nodeStatus with a currentRevision + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: [] + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + currentRevision: 0 + expectedStatusError: "status.nodeStatuses[0]: Invalid value: \"object\": currentRevision can not be set on creation of a nodeStatus" + - name: Should reject setting new nodeStatus with a targetRevision + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: [] + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + targetRevision: 0 + expectedStatusError: "status.nodeStatuses[0]: Invalid value: \"object\": targetRevision can not be set on creation of a nodeStatus" + - name: Should allow adding nodes with name only + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + - nodeName: b + expected: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: + logLevel: Normal + operatorLogLevel: Normal + status: + nodeStatuses: + - nodeName: a + - nodeName: b + - name: Should allow updating currentRevision of existing nodeStatus + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + currentRevision: 1 + expected: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: + logLevel: Normal + operatorLogLevel: Normal + status: + nodeStatuses: + - nodeName: a + currentRevision: 1 + - name: Should allow updating targetRevision of existing nodeStatus + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + targetRevision: 1 + expected: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: + logLevel: Normal + operatorLogLevel: Normal + status: + nodeStatuses: + - nodeName: a + targetRevision: 1 diff --git a/operator/v1/types.go b/operator/v1/types.go index 284dfe54dd9..2f4c9c4c5a0 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -258,15 +258,21 @@ type StaticPodOperatorStatus struct { // NodeStatus provides information about the current state of a particular node managed by this operator. // +kubebuilder:validation:XValidation:rule="has(self.currentRevision) || !has(oldSelf.currentRevision)",message="cannot be unset once set",fieldPath=".currentRevision" +// +kubebuilder:validation:XValidation:rule="oldSelf.hasValue() || !has(self.currentRevision)",message="currentRevision can not be set on creation of a nodeStatus",optionalOldSelf=true +// +kubebuilder:validation:XValidation:rule="oldSelf.hasValue() || !has(self.targetRevision)",message="targetRevision can not be set on creation of a nodeStatus",optionalOldSelf=true type NodeStatus struct { // nodeName is the name of the node // +required NodeName string `json:"nodeName"` - // currentRevision is the generation of the most recently successful deployment + // currentRevision is the generation of the most recently successful deployment. + // Can not be set on creation of a nodeStatus. Updates must only increase the value. // +kubebuilder:validation:XValidation:rule="self >= oldSelf",message="must only increase" - CurrentRevision int32 `json:"currentRevision"` - // targetRevision is the generation of the deployment we're trying to apply + // +optional + CurrentRevision int32 `json:"currentRevision,omitempty"` + // targetRevision is the generation of the deployment we're trying to apply. + // Can not be set on creation of a nodeStatus. + // +optional TargetRevision int32 `json:"targetRevision,omitempty"` // lastFailedRevision is the generation of the deployment we tried and failed to deploy. diff --git a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml index 294921e4767..5c08eb4ba1b 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-Default.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-Default.crd.yaml index 7a41ad8bfa8..9a332d565f4 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-Default.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-Default.crd.yaml @@ -239,8 +239,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -279,8 +280,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -290,6 +292,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml index 71376efe1cb..e92b2be6b1b 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml index 53ee94c57cd..458dfe534a7 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml index 189f1270489..a9a107b3f74 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml @@ -221,8 +221,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -261,8 +262,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -272,6 +274,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml index 7b6b138b7fa..af66b058ea3 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml @@ -230,8 +230,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -270,8 +271,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -281,6 +283,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.crd-manifests/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml b/operator/v1/zz_generated.crd-manifests/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml index ced827d0a73..192c3562be5 100644 --- a/operator/v1/zz_generated.crd-manifests/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml +++ b/operator/v1/zz_generated.crd-manifests/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml @@ -221,8 +221,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -261,8 +262,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -272,6 +274,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/AAA_ungated.yaml index 1da91b435f3..8a28ebf7676 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/AAA_ungated.yaml @@ -226,8 +226,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -266,8 +267,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -277,6 +279,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/EtcdBackendQuota.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/EtcdBackendQuota.yaml index 12191298b0f..dc749c411bc 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/EtcdBackendQuota.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/EtcdBackendQuota.yaml @@ -239,8 +239,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -279,8 +280,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -290,6 +292,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/HardwareSpeed.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/HardwareSpeed.yaml index e27d4310ce7..1008839ef78 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/HardwareSpeed.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/etcds.operator.openshift.io/HardwareSpeed.yaml @@ -239,8 +239,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -279,8 +280,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -290,6 +292,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml index 77210d02c45..90135f5bf20 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml @@ -222,8 +222,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -262,8 +263,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -273,6 +275,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/kubecontrollermanagers.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/kubecontrollermanagers.operator.openshift.io/AAA_ungated.yaml index 1a208bcd1e4..afe514a8b35 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/kubecontrollermanagers.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/kubecontrollermanagers.operator.openshift.io/AAA_ungated.yaml @@ -231,8 +231,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -271,8 +272,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -282,6 +284,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.featuregated-crd-manifests/kubeschedulers.operator.openshift.io/AAA_ungated.yaml b/operator/v1/zz_generated.featuregated-crd-manifests/kubeschedulers.operator.openshift.io/AAA_ungated.yaml index c5d2794c04c..6341149bfce 100644 --- a/operator/v1/zz_generated.featuregated-crd-manifests/kubeschedulers.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/zz_generated.featuregated-crd-manifests/kubeschedulers.operator.openshift.io/AAA_ungated.yaml @@ -222,8 +222,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -262,8 +263,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -273,6 +275,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index 944dd45abf7..75448ecd457 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -37,8 +37,8 @@ func (MyOperatorResource) SwaggerDoc() map[string]string { var map_NodeStatus = map[string]string{ "": "NodeStatus provides information about the current state of a particular node managed by this operator.", "nodeName": "nodeName is the name of the node", - "currentRevision": "currentRevision is the generation of the most recently successful deployment", - "targetRevision": "targetRevision is the generation of the deployment we're trying to apply", + "currentRevision": "currentRevision is the generation of the most recently successful deployment. Can not be set on creation of a nodeStatus. Updates must only increase the value.", + "targetRevision": "targetRevision is the generation of the deployment we're trying to apply. Can not be set on creation of a nodeStatus.", "lastFailedRevision": "lastFailedRevision is the generation of the deployment we tried and failed to deploy.", "lastFailedTime": "lastFailedTime is the time the last failed revision failed the last time.", "lastFailedReason": "lastFailedReason is a machine readable failure reason string.", diff --git a/payload-manifests/crds/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml b/payload-manifests/crds/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml index 294921e4767..5c08eb4ba1b 100644 --- a/payload-manifests/crds/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml +++ b/payload-manifests/crds/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_12_etcd_01_etcds-Default.crd.yaml b/payload-manifests/crds/0000_12_etcd_01_etcds-Default.crd.yaml index 7a41ad8bfa8..9a332d565f4 100644 --- a/payload-manifests/crds/0000_12_etcd_01_etcds-Default.crd.yaml +++ b/payload-manifests/crds/0000_12_etcd_01_etcds-Default.crd.yaml @@ -239,8 +239,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -279,8 +280,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -290,6 +292,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml b/payload-manifests/crds/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml index 71376efe1cb..e92b2be6b1b 100644 --- a/payload-manifests/crds/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml +++ b/payload-manifests/crds/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml b/payload-manifests/crds/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml index 53ee94c57cd..458dfe534a7 100644 --- a/payload-manifests/crds/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml +++ b/payload-manifests/crds/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml @@ -252,8 +252,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -292,8 +293,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -303,6 +305,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml b/payload-manifests/crds/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml index 189f1270489..a9a107b3f74 100644 --- a/payload-manifests/crds/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml +++ b/payload-manifests/crds/0000_20_kube-apiserver_01_kubeapiservers.crd.yaml @@ -221,8 +221,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -261,8 +262,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -272,6 +274,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml b/payload-manifests/crds/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml index 7b6b138b7fa..af66b058ea3 100644 --- a/payload-manifests/crds/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml +++ b/payload-manifests/crds/0000_25_kube-controller-manager_01_kubecontrollermanagers.crd.yaml @@ -230,8 +230,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -270,8 +271,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -281,6 +283,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName diff --git a/payload-manifests/crds/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml b/payload-manifests/crds/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml index ced827d0a73..192c3562be5 100644 --- a/payload-manifests/crds/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml +++ b/payload-manifests/crds/0000_25_kube-scheduler_01_kubeschedulers.crd.yaml @@ -221,8 +221,9 @@ spec: of a particular node managed by this operator. properties: currentRevision: - description: currentRevision is the generation of the most recently - successful deployment + description: |- + currentRevision is the generation of the most recently successful deployment. + Can not be set on creation of a nodeStatus. Updates must only increase the value. format: int32 type: integer x-kubernetes-validations: @@ -261,8 +262,9 @@ spec: description: nodeName is the name of the node type: string targetRevision: - description: targetRevision is the generation of the deployment - we're trying to apply + description: |- + targetRevision is the generation of the deployment we're trying to apply. + Can not be set on creation of a nodeStatus. format: int32 type: integer required: @@ -272,6 +274,12 @@ spec: - fieldPath: .currentRevision message: cannot be unset once set rule: has(self.currentRevision) || !has(oldSelf.currentRevision) + - message: currentRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.currentRevision) + - message: targetRevision can not be set on creation of a nodeStatus + optionalOldSelf: true + rule: oldSelf.hasValue() || !has(self.targetRevision) type: array x-kubernetes-list-map-keys: - nodeName