diff --git a/data/data/install.openshift.io_installconfigs.yaml b/data/data/install.openshift.io_installconfigs.yaml index cf0ebc88ca1..a1cb9cedfe4 100644 --- a/data/data/install.openshift.io_installconfigs.yaml +++ b/data/data/install.openshift.io_installconfigs.yaml @@ -150,6 +150,15 @@ spec: For the compute machine pools, the only valid name is "worker". For the arbiter machine pools, the only valid name is "arbiter". type: string + osImageStream: + description: |- + OSImageStream specifies the OS Image Stream to use for machines in this pool. + When set, this value overrides the global osImageStream defined in the InstallConfig. + When unset, machines in this pool will inherit the global osImageStream value if configured, + or fall back to the cluster's default OS image stream if neither value is set. + This allows different machine pools to use different OS image streams while maintaining + a common default for the cluster. + type: string platform: description: Platform is configuration for machine pool specific to the platform. @@ -1710,6 +1719,15 @@ spec: For the compute machine pools, the only valid name is "worker". For the arbiter machine pools, the only valid name is "arbiter". type: string + osImageStream: + description: |- + OSImageStream specifies the OS Image Stream to use for machines in this pool. + When set, this value overrides the global osImageStream defined in the InstallConfig. + When unset, machines in this pool will inherit the global osImageStream value if configured, + or fall back to the cluster's default OS image stream if neither value is set. + This allows different machine pools to use different OS image streams while maintaining + a common default for the cluster. + type: string platform: description: Platform is configuration for machine pool specific to the platform. @@ -3210,6 +3228,15 @@ spec: For the compute machine pools, the only valid name is "worker". For the arbiter machine pools, the only valid name is "arbiter". type: string + osImageStream: + description: |- + OSImageStream specifies the OS Image Stream to use for machines in this pool. + When set, this value overrides the global osImageStream defined in the InstallConfig. + When unset, machines in this pool will inherit the global osImageStream value if configured, + or fall back to the cluster's default OS image stream if neither value is set. + This allows different machine pools to use different OS image streams while maintaining + a common default for the cluster. + type: string platform: description: Platform is configuration for machine pool specific to the platform. @@ -4885,6 +4912,14 @@ spec: - Internal type: string type: object + osImageStream: + description: |- + OSImageStream is the global OS Image Stream to be used for all machines in the cluster. + This value serves as the default for all machine pools (control plane, compute, arbiter). + Individual machine pools can override this value by specifying their own osImageStream. + When both this field and the machine pool's osImageStream are unset, the cluster will + use its own default OS image stream. + type: string platform: description: |- Platform is the configuration for the specific platform upon which to diff --git a/pkg/explain/printer_test.go b/pkg/explain/printer_test.go index 9ff0744de99..59c4c9490ed 100644 --- a/pkg/explain/printer_test.go +++ b/pkg/explain/printer_test.go @@ -135,6 +135,13 @@ the cluster. operatorPublishingStrategy OperatorPublishingStrategy controls the visibility of ingress and apiserver. Defaults to public. + osImageStream + OSImageStream is the global OS Image Stream to be used for all machines in the cluster. +This value serves as the default for all machine pools (control plane, compute, arbiter). +Individual machine pools can override this value by specifying their own osImageStream. +When both this field and the machine pool's osImageStream are unset, the cluster will +use its own default OS image stream. + platform -required- Platform is the configuration for the specific platform upon which to perform the installation. diff --git a/pkg/types/defaults/validation/featuregates.go b/pkg/types/defaults/validation/featuregates.go index 9d48aac1941..2171fa35b19 100644 --- a/pkg/types/defaults/validation/featuregates.go +++ b/pkg/types/defaults/validation/featuregates.go @@ -35,5 +35,32 @@ func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeat }(), Field: field.NewPath("compute", "diskSetup"), }, + { + FeatureGateName: features.FeatureGateOSStreams, + Condition: len(c.OSImageStream) != 0, + Field: field.NewPath("osImageStream"), + }, + { + FeatureGateName: features.FeatureGateOSStreams, + Condition: c.ControlPlane != nil && len(c.ControlPlane.OSImageStream) != 0, + Field: field.NewPath("controlPlane", "osImageStream"), + }, + { + FeatureGateName: features.FeatureGateOSStreams, + Condition: c.Arbiter != nil && len(c.Arbiter.OSImageStream) != 0, + Field: field.NewPath("arbiter", "osImageStream"), + }, + { + FeatureGateName: features.FeatureGateOSStreams, + Condition: func() bool { + for _, compute := range c.Compute { + if len(compute.OSImageStream) != 0 { + return true + } + } + return false + }(), + Field: field.NewPath("compute", "osImageStream"), + }, } } diff --git a/pkg/types/installconfig.go b/pkg/types/installconfig.go index f0487367663..4485b3b92e8 100644 --- a/pkg/types/installconfig.go +++ b/pkg/types/installconfig.go @@ -228,6 +228,15 @@ type InstallConfig struct { // E.g. "featureGates": ["FeatureGate1=true", "FeatureGate2=false"]. // +optional FeatureGates []string `json:"featureGates,omitempty"` + + // OSImageStream is the global OS Image Stream to be used for all machines in the cluster. + // This value serves as the default for all machine pools (control plane, compute, arbiter). + // Individual machine pools can override this value by specifying their own osImageStream. + // When both this field and the machine pool's osImageStream are unset, the cluster will + // use its own default OS image stream. + // + // +optional + OSImageStream string `json:"osImageStream,omitempty"` } // ClusterDomain returns the DNS domain that all records for a cluster must belong to. diff --git a/pkg/types/machinepools.go b/pkg/types/machinepools.go index e67cf5b0ddd..4086d0484c6 100644 --- a/pkg/types/machinepools.go +++ b/pkg/types/machinepools.go @@ -128,6 +128,16 @@ type MachinePool struct { // The available types are etcd, swap and user-defined. // +optional DiskSetup []Disk `json:"diskSetup,omitempty"` + + // OSImageStream specifies the OS Image Stream to use for machines in this pool. + // When set, this value overrides the global osImageStream defined in the InstallConfig. + // When unset, machines in this pool will inherit the global osImageStream value if configured, + // or fall back to the cluster's default OS image stream if neither value is set. + // This allows different machine pools to use different OS image streams while maintaining + // a common default for the cluster. + // + // +optional + OSImageStream string `json:"osImageStream,omitempty"` } // MachinePoolPlatform is the platform-specific configuration for a machine