Skip to content

Commit d135445

Browse files
committed
MCO-2031: OS Image Stream to install-config schema
This change introduces the OS Image Stream concept to the install-config to facilitate day-zero stream selection. The change adds an optional global field that can be used to set the OS Image Stream to pick for all the pools and a per pool field to override it or to just set the stream in a specific pool.
1 parent 4820a10 commit d135445

File tree

4 files changed

+81
-0
lines changed

4 files changed

+81
-0
lines changed

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ spec:
150150
For the compute machine pools, the only valid name is "worker".
151151
For the arbiter machine pools, the only valid name is "arbiter".
152152
type: string
153+
osImageStream:
154+
description: |-
155+
OSImageStream specifies the OS Image Stream to use for machines in this pool.
156+
When set, this value overrides the global osImageStream defined in the InstallConfig.
157+
When unset, machines in this pool will inherit the global osImageStream value if configured,
158+
or fall back to the cluster's default OS image stream if neither value is set.
159+
This allows different machine pools to use different OS image streams while maintaining
160+
a common default for the cluster.
161+
type: string
153162
platform:
154163
description: Platform is configuration for machine pool specific to
155164
the platform.
@@ -1710,6 +1719,15 @@ spec:
17101719
For the compute machine pools, the only valid name is "worker".
17111720
For the arbiter machine pools, the only valid name is "arbiter".
17121721
type: string
1722+
osImageStream:
1723+
description: |-
1724+
OSImageStream specifies the OS Image Stream to use for machines in this pool.
1725+
When set, this value overrides the global osImageStream defined in the InstallConfig.
1726+
When unset, machines in this pool will inherit the global osImageStream value if configured,
1727+
or fall back to the cluster's default OS image stream if neither value is set.
1728+
This allows different machine pools to use different OS image streams while maintaining
1729+
a common default for the cluster.
1730+
type: string
17131731
platform:
17141732
description: Platform is configuration for machine pool specific
17151733
to the platform.
@@ -3210,6 +3228,15 @@ spec:
32103228
For the compute machine pools, the only valid name is "worker".
32113229
For the arbiter machine pools, the only valid name is "arbiter".
32123230
type: string
3231+
osImageStream:
3232+
description: |-
3233+
OSImageStream specifies the OS Image Stream to use for machines in this pool.
3234+
When set, this value overrides the global osImageStream defined in the InstallConfig.
3235+
When unset, machines in this pool will inherit the global osImageStream value if configured,
3236+
or fall back to the cluster's default OS image stream if neither value is set.
3237+
This allows different machine pools to use different OS image streams while maintaining
3238+
a common default for the cluster.
3239+
type: string
32133240
platform:
32143241
description: Platform is configuration for machine pool specific to
32153242
the platform.
@@ -4885,6 +4912,14 @@ spec:
48854912
- Internal
48864913
type: string
48874914
type: object
4915+
osImageStream:
4916+
description: |-
4917+
OSImageStream is the global OS Image Stream to be used for all machines in the cluster.
4918+
This value serves as the default for all machine pools (control plane, compute, arbiter).
4919+
Individual machine pools can override this value by specifying their own osImageStream.
4920+
When both this field and the machine pool's osImageStream are unset, the cluster will
4921+
use its own default OS image stream.
4922+
type: string
48884923
platform:
48894924
description: |-
48904925
Platform is the configuration for the specific platform upon which to

pkg/types/defaults/validation/featuregates.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,32 @@ func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeat
3535
}(),
3636
Field: field.NewPath("compute", "diskSetup"),
3737
},
38+
{
39+
FeatureGateName: features.FeatureGateOSStreams,
40+
Condition: len(c.OSImageStream) != 0,
41+
Field: field.NewPath("osImageStream"),
42+
},
43+
{
44+
FeatureGateName: features.FeatureGateOSStreams,
45+
Condition: c.ControlPlane != nil && len(c.ControlPlane.OSImageStream) != 0,
46+
Field: field.NewPath("controlPlane", "osImageStream"),
47+
},
48+
{
49+
FeatureGateName: features.FeatureGateOSStreams,
50+
Condition: c.Arbiter != nil && len(c.Arbiter.OSImageStream) != 0,
51+
Field: field.NewPath("arbiter", "osImageStream"),
52+
},
53+
{
54+
FeatureGateName: features.FeatureGateOSStreams,
55+
Condition: func() bool {
56+
for _, compute := range c.Compute {
57+
if len(compute.OSImageStream) != 0 {
58+
return true
59+
}
60+
}
61+
return false
62+
}(),
63+
Field: field.NewPath("compute", "osImageStream"),
64+
},
3865
}
3966
}

pkg/types/installconfig.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ type InstallConfig struct {
228228
// E.g. "featureGates": ["FeatureGate1=true", "FeatureGate2=false"].
229229
// +optional
230230
FeatureGates []string `json:"featureGates,omitempty"`
231+
232+
// OSImageStream is the global OS Image Stream to be used for all machines in the cluster.
233+
// This value serves as the default for all machine pools (control plane, compute, arbiter).
234+
// Individual machine pools can override this value by specifying their own osImageStream.
235+
// When both this field and the machine pool's osImageStream are unset, the cluster will
236+
// use its own default OS image stream.
237+
//
238+
// +optional
239+
OSImageStream string `json:"osImageStream,omitempty"`
231240
}
232241

233242
// ClusterDomain returns the DNS domain that all records for a cluster must belong to.

pkg/types/machinepools.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ type MachinePool struct {
128128
// The available types are etcd, swap and user-defined.
129129
// +optional
130130
DiskSetup []Disk `json:"diskSetup,omitempty"`
131+
132+
// OSImageStream specifies the OS Image Stream to use for machines in this pool.
133+
// When set, this value overrides the global osImageStream defined in the InstallConfig.
134+
// When unset, machines in this pool will inherit the global osImageStream value if configured,
135+
// or fall back to the cluster's default OS image stream if neither value is set.
136+
// This allows different machine pools to use different OS image streams while maintaining
137+
// a common default for the cluster.
138+
//
139+
// +optional
140+
OSImageStream string `json:"osImageStream,omitempty"`
131141
}
132142

133143
// MachinePoolPlatform is the platform-specific configuration for a machine

0 commit comments

Comments
 (0)