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 5e9d68e02ba..f0b8c4daa85 100644 --- a/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml +++ b/operator/v1/tests/kubeapiservers.operator.openshift.io/AAA_ungated.yaml @@ -14,3 +14,66 @@ tests: spec: logLevel: Normal operatorLogLevel: Normal + onUpdate: + - name: Should reject multiple nodes with nonzero target revisions + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + targetRevision: 1 + - nodeName: b + targetRevision: 0 + - nodeName: c + - nodeName: d + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + targetRevision: 1 + - nodeName: b + targetRevision: 0 + - nodeName: c + targetRevision: 2 + - nodeName: d + expectedStatusError: "status.nodeStatuses: Invalid value: \"array\": no more than 1 node status may have a nonzero targetRevision" + - name: Should reject decreasing currentRevision + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + currentRevision: 3 + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + currentRevision: 2 + expectedStatusError: "status.nodeStatuses[0].currentRevision: Invalid value: \"integer\": must only increase" + - name: Should reject clearing currentRevision + initial: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + currentRevision: 3 + updated: | + apiVersion: operator.openshift.io/v1 + kind: KubeAPIServer + spec: {} # No spec is required for a KubeAPIServer + status: + nodeStatuses: + - nodeName: a + expectedStatusError: "status.nodeStatuses[0].currentRevision: Invalid value: \"object\": cannot be unset once set" diff --git a/operator/v1/types.go b/operator/v1/types.go index b46448c8d68..284dfe54dd9 100644 --- a/operator/v1/types.go +++ b/operator/v1/types.go @@ -252,16 +252,19 @@ type StaticPodOperatorStatus struct { // +listType=map // +listMapKey=nodeName // +optional + // +kubebuilder:validation:XValidation:rule="size(self.filter(status, status.?targetRevision.orValue(0) != 0)) <= 1",message="no more than 1 node status may have a nonzero targetRevision" NodeStatuses []NodeStatus `json:"nodeStatuses,omitempty"` } // 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" 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 + // +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 TargetRevision int32 `json:"targetRevision,omitempty"` 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 b68cce4db30..294921e4767 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 ebe2486ef5b..7a41ad8bfa8 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 @@ -243,6 +243,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -283,10 +286,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 bc49df765d5..71376efe1cb 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 8449c20a6c3..53ee94c57cd 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 435a8a81ee1..189f1270489 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 @@ -225,6 +225,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -265,10 +268,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 7cd18e09b5e..7b6b138b7fa 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 @@ -234,6 +234,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -274,10 +277,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 9654facc4d2..ced827d0a73 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 @@ -225,6 +225,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -265,10 +268,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 4db2817444a..1da91b435f3 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 @@ -230,6 +230,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -270,10 +273,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 136df990781..12191298b0f 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 @@ -243,6 +243,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -283,10 +286,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 73a47031f8c..e27d4310ce7 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 @@ -243,6 +243,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -283,10 +286,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 6586f30a896..77210d02c45 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 @@ -226,6 +226,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -266,10 +269,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 086aa9a3704..1a208bcd1e4 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 @@ -235,6 +235,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -275,10 +278,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 bca1546d704..c5d2794c04c 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 @@ -226,6 +226,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -266,10 +269,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 b68cce4db30..294921e4767 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 ebe2486ef5b..7a41ad8bfa8 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 @@ -243,6 +243,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -283,10 +286,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 bc49df765d5..71376efe1cb 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 8449c20a6c3..53ee94c57cd 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 @@ -256,6 +256,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -296,10 +299,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 435a8a81ee1..189f1270489 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 @@ -225,6 +225,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -265,10 +268,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 7cd18e09b5e..7b6b138b7fa 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 @@ -234,6 +234,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -274,10 +277,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with 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 9654facc4d2..ced827d0a73 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 @@ -225,6 +225,9 @@ spec: successful deployment format: int32 type: integer + x-kubernetes-validations: + - message: must only increase + rule: self >= oldSelf lastFailedCount: description: lastFailedCount is how often the installer pod of the last failed revision failed. @@ -265,10 +268,18 @@ spec: required: - nodeName type: object + x-kubernetes-validations: + - fieldPath: .currentRevision + message: cannot be unset once set + rule: has(self.currentRevision) || !has(oldSelf.currentRevision) type: array x-kubernetes-list-map-keys: - nodeName x-kubernetes-list-type: map + x-kubernetes-validations: + - message: no more than 1 node status may have a nonzero targetRevision + rule: size(self.filter(status, status.?targetRevision.orValue(0) + != 0)) <= 1 observedGeneration: description: observedGeneration is the last generation change you've dealt with