Skip to content

Commit ef71013

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 e577b4d commit ef71013

22 files changed

+8464
-586
lines changed

features.md

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
| MinimumKubeletVersion| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
4444
| MixedCPUsAllocation| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
4545
| NodeSwap| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
46+
| NonReconcilableMC| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
4647
| NutanixMultiSubnets| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
4748
| OVNObservability| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
4849
| PinnedImages| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |

features/features.go

+592-584
Large diffs are not rendered by default.

openapi/generated_openapi/zz_generated.openapi.go

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

openapi/openapi.json

+4
Original file line numberDiff line numberDiff line change
@@ -30550,6 +30550,10 @@
3055030550
"description": "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.\n\nValid values are: \"Normal\", \"Debug\", \"Trace\", \"TraceAll\". Defaults to \"Normal\".",
3055130551
"type": "string"
3055230552
},
30553+
"machineConfigurationValidationPolicy": {
30554+
"description": "machineConfigurationValidationPolicy tells the operator how new machine configurations should be validated. Allowed values are Strict, Relaxed, and omitted. DefaultValidationPolicy represents a configuration validation mode chosen by the system. Currently, the default is StrictValidationPolicy. StrictValidationPolicy represents a configuration validation mode that enforces that changes to the rendered MCs are not altering fields outside the supported ones. More info about supported fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/machine_configuration/machine-config-index#what-can-you-change-with-machine-configs RelaxedValidationPolicy represents a configuration validation mode that does not perform any validation over the fields that cannot be changed. Usage of this mode is discouraged.",
30555+
"type": "string"
30556+
},
3055330557
"managedBootImages": {
3055430558
"description": "managedBootImages allows configuration for the management of boot images for machine resources within the cluster. This configuration allows users to select resources that should be updated to the latest boot images during cluster upgrades, ensuring that new machines always boot with the current cluster version's boot image. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The default for each machine manager mode is All for GCP and AWS platforms, and None for all other platforms.",
3055530559
"default": {},

operator/v1/types_machineconfiguration.go

+34
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,42 @@ type MachineConfigurationSpec struct {
5656
// +openshift:enable:FeatureGate=NodeDisruptionPolicy
5757
// +optional
5858
NodeDisruptionPolicy NodeDisruptionPolicyConfig `json:"nodeDisruptionPolicy"`
59+
60+
// machineConfigurationValidationPolicy tells the operator how new machine configurations should be validated.
61+
// Allowed values are Strict, Relaxed, and omitted.
62+
// DefaultValidationPolicy represents a configuration validation mode chosen by the system. Currently, the default
63+
// is StrictValidationPolicy.
64+
// StrictValidationPolicy represents a configuration validation mode that enforces that changes to the rendered
65+
// MCs are not altering fields outside the supported ones.
66+
// More info about supported fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/machine_configuration/machine-config-index#what-can-you-change-with-machine-configs
67+
// RelaxedValidationPolicy represents a configuration validation mode that does not perform any validation over
68+
// the fields that cannot be changed. Usage of this mode is discouraged.
69+
// +optional
70+
// +openshift:enable:FeatureGate=NonReconcilableMC
71+
MachineConfigurationValidationPolicy MachineConfigurationValidationPolicy `json:"machineConfigurationValidationPolicy,omitempty"`
5972
}
6073

74+
// MachineConfigurationValidationPolicy is the type of validation the MCO applies to incoming MachineConfiguration
75+
// changes. Allowed values are Strict, Relaxed, and omitted.
76+
//
77+
// +kubebuilder:validation:Enum="";Strict;Relaxed
78+
type MachineConfigurationValidationPolicy string
79+
80+
const (
81+
// DefaultValidationPolicy represents a configuration validation mode chosen by the system. Currently, the default
82+
// is StrictValidationPolicy.
83+
DefaultValidationPolicy MachineConfigurationValidationPolicy = ""
84+
85+
// StrictValidationPolicy represents a configuration validation mode that enforces that changes to the rendered
86+
// MCs are not altering fields outside the supported ones.
87+
// More info about supported fields: https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/machine_configuration/machine-config-index#what-can-you-change-with-machine-configs
88+
StrictValidationPolicy MachineConfigurationValidationPolicy = "Strict"
89+
90+
// RelaxedValidationPolicy represents a configuration validation mode that does not perform any validation over
91+
// the fields that cannot be changed. Usage of this mode is discouraged.
92+
RelaxedValidationPolicy MachineConfigurationValidationPolicy = "Relaxed"
93+
)
94+
6195
type MachineConfigurationStatus struct {
6296
// observedGeneration is the last generation change you've dealt with
6397
// +optional

0 commit comments

Comments
 (0)