You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MachineOSConfig name should match MachineConfigPool
Add a restriction where the name of the MachineOSConfig
object must be the same as the MachineConfigPool it is
created for. This will ensure that we only have one MOSC
per MCP.
Signed-off-by: Urvashi <[email protected]>
Copy file name to clipboardExpand all lines: machineconfiguration/v1/types_machineosconfig.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import (
18
18
// MachineOSConfig describes the configuration for a build process managed by the MCO
19
19
// Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
20
20
// +openshift:compatibility-gen:level=1
21
+
// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.machineConfigPool.name || oldSelf.hasValue() && oldSelf.spec.machineConfigPool.name.value() == self.spec.machineConfigPool.name",optionalOldSelf=true,message="MachineOSConfig name must match the referenced MachineConfigPool name; can only have one MachineOSConfig per MachineConfigPool"
Copy file name to clipboardExpand all lines: machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineosconfigs.machineconfiguration.openshift.io/OnClusterBuild.yaml
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -346,6 +346,12 @@ spec:
346
346
required:
347
347
- spec
348
348
type: object
349
+
x-kubernetes-validations:
350
+
- message: MachineOSConfig name must match the referenced MachineConfigPool
351
+
name; can only have one MachineOSConfig per MachineConfigPool
0 commit comments