Skip to content

Commit 6fd81f1

Browse files
committed
[MCO] Add a flag to allow irreconcilable configs
The flag will tell the operator to skip the irreconcilable fields validation and let the user update/patch conflictive MCs in the cluster at his own risk. This feature is specially thought to allow users to add new nodes in a long standing cluster with newer configuration.
1 parent 23e3de4 commit 6fd81f1

File tree

9 files changed

+78
-2
lines changed

9 files changed

+78
-2
lines changed

openapi/generated_openapi/zz_generated.openapi.go

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openapi/openapi.json

+5
Original file line numberDiff line numberDiff line change
@@ -30146,6 +30146,11 @@
3014630146
"forceRedeploymentReason"
3014730147
],
3014830148
"properties": {
30149+
"configurationValidationPolicy": {
30150+
"description": "machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes in already existing nodes. New nodes joining the cluster will see the newest configuration. Valid values are Strict and Relaxed.",
30151+
"type": "string",
30152+
"default": "Strict"
30153+
},
3014930154
"failedRevisionLimit": {
3015030155
"description": "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)",
3015130156
"type": "integer",

operator/v1/types_machineconfiguration.go

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
55
)
66

7+
type MachineConfigurationValidationPolicy string
8+
79
// +genclient
810
// +genclient:nonNamespaced
911
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -56,6 +58,16 @@ type MachineConfigurationSpec struct {
5658
// +openshift:enable:FeatureGate=NodeDisruptionPolicy
5759
// +optional
5860
NodeDisruptionPolicy NodeDisruptionPolicyConfig `json:"nodeDisruptionPolicy"`
61+
62+
63+
// machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
64+
// in already existing nodes. New nodes joining the cluster will see the newest configuration.
65+
// Valid values are Strict and Relaxed.
66+
// +kubebuilder:validation:Enum=Strict;Relaxed
67+
// +kubebuilder:validation:Default=Strict
68+
// +default="Strict"
69+
// +optional
70+
ConfigurationValidationPolicy MachineConfigurationValidationPolicy `json:"configurationValidationPolicy,omitempty"`
5971
}
6072

6173
type MachineConfigurationStatus struct {

operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations.crd.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ spec:
4545
description: spec is the specification of the desired behavior of the
4646
Machine Config Operator
4747
properties:
48+
configurationValidationPolicy:
49+
default: Strict
50+
description: |-
51+
machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
52+
in already existing nodes. New nodes joining the cluster will see the newest configuration.
53+
Valid values are Strict and Relaxed.
54+
enum:
55+
- Strict
56+
- Relaxed
57+
type: string
4858
failedRevisionLimit:
4959
description: |-
5060
failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api

operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/AAA_ungated.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ spec:
4646
description: spec is the specification of the desired behavior of the
4747
Machine Config Operator
4848
properties:
49+
configurationValidationPolicy:
50+
default: Strict
51+
description: |-
52+
machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
53+
in already existing nodes. New nodes joining the cluster will see the newest configuration.
54+
Valid values are Strict and Relaxed.
55+
enum:
56+
- Strict
57+
- Relaxed
58+
type: string
4959
failedRevisionLimit:
5060
description: |-
5161
failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api

operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/ManagedBootImages.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ spec:
4646
description: spec is the specification of the desired behavior of the
4747
Machine Config Operator
4848
properties:
49+
configurationValidationPolicy:
50+
default: Strict
51+
description: |-
52+
machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
53+
in already existing nodes. New nodes joining the cluster will see the newest configuration.
54+
Valid values are Strict and Relaxed.
55+
enum:
56+
- Strict
57+
- Relaxed
58+
type: string
4959
failedRevisionLimit:
5060
description: |-
5161
failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api

operator/v1/zz_generated.featuregated-crd-manifests/machineconfigurations.operator.openshift.io/NodeDisruptionPolicy.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ spec:
4646
description: spec is the specification of the desired behavior of the
4747
Machine Config Operator
4848
properties:
49+
configurationValidationPolicy:
50+
default: Strict
51+
description: |-
52+
machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
53+
in already existing nodes. New nodes joining the cluster will see the newest configuration.
54+
Valid values are Strict and Relaxed.
55+
enum:
56+
- Strict
57+
- Relaxed
58+
type: string
4959
failedRevisionLimit:
5060
description: |-
5161
failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api

operator/v1/zz_generated.swagger_doc_generated.go

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payload-manifests/crds/0000_80_machine-config_01_machineconfigurations.crd.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ spec:
4545
description: spec is the specification of the desired behavior of the
4646
Machine Config Operator
4747
properties:
48+
configurationValidationPolicy:
49+
default: Strict
50+
description: |-
51+
machineConfigValidationPolicy tells the operator to ignore irreconciliable configuration changes
52+
in already existing nodes. New nodes joining the cluster will see the newest configuration.
53+
Valid values are Strict and Relaxed.
54+
enum:
55+
- Strict
56+
- Relaxed
57+
type: string
4858
failedRevisionLimit:
4959
description: |-
5060
failedRevisionLimit is the number of failed static pod installer revisions to keep on disk and in the api

0 commit comments

Comments
 (0)