Skip to content

Commit 604c1da

Browse files
committed
bootimage: enable opt-out for azure and vsphere
1 parent 220665b commit 604c1da

3 files changed

Lines changed: 24 additions & 24 deletions

File tree

pkg/controller/common/featuregates.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ func IsBootImageControllerRequired(ctx *ControllerContext) bool {
157157
// Current platform support:
158158
// - GCP: FeatureGateManagedBootImages (opt-out), CPMS supported
159159
// - AWS: FeatureGateManagedBootImagesAWS (opt-out), CPMS supported
160-
// - vSphere: FeatureGateManagedBootImagesvSphere (opt-in), CPMS not supported
161-
// - Azure: FeatureGateManagedBootImagesAzure (opt-in), CPMS supported (except AzureStackCloud)
160+
// - vSphere: FeatureGateManagedBootImagesvSphere (opt-out), CPMS not supported
161+
// - Azure: FeatureGateManagedBootImagesAzure (opt-out), CPMS supported (except AzureStackCloud)
162162
//
163163
// Returns:
164164
// - supported: whether the platform supports boot image updates on machinesets
@@ -171,15 +171,15 @@ func CheckBootImagePlatform(infra *configv1.Infrastructure, fgHandler FeatureGat
171171
case configv1.GCPPlatformType:
172172
return fgHandler.Enabled(features.FeatureGateManagedBootImages), true, true
173173
case configv1.VSpherePlatformType:
174-
return fgHandler.Enabled(features.FeatureGateManagedBootImagesvSphere), false, false
174+
return fgHandler.Enabled(features.FeatureGateManagedBootImagesvSphere), false, true
175175
case configv1.AzurePlatformType:
176176
// Special variant check for Azure platforms; AzureStackCloud boot images are defined at install time
177177
// See: https://github.com/openshift/installer/blob/bc941c822f06c10a95ddd080ae6345c25968baf4/pkg/asset/installconfig/azure/validation.go#L743-L749
178178
if infra.Status.PlatformStatus.Azure != nil && infra.Status.PlatformStatus.Azure.CloudName == configv1.AzureStackCloud {
179179
klog.Infof(" %s is not supported for boot image updates; disabling boot image controller", configv1.AzureStackCloud)
180180
return false, false, false
181181
}
182-
return fgHandler.Enabled(features.FeatureGateManagedBootImagesAzure), true, false
182+
return fgHandler.Enabled(features.FeatureGateManagedBootImagesAzure), true, true
183183
}
184184
return false, false, false
185185
}

pkg/operator/sync_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -407,30 +407,30 @@ func TestSyncMachineConfiguration(t *testing.T) {
407407
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.18.0"),
408408
},
409409
{
410-
name: "Azure platform, no existing config, no opt-in expected",
410+
name: "Azure platform, no existing config, opt-in expected",
411411
infra: buildInfra(withPlatformType(configv1.AzurePlatformType)),
412412
mcop: buildMachineConfigurationWithNoBootImageConfiguration(),
413413
clusterVersion: buildClusterVersion("4.18.0"),
414-
annotationExpected: false,
414+
annotationExpected: true,
415415
expectedManagedBootImagesStatus: opv1.ManagedBootImages{
416416
MachineManagers: []opv1.MachineManager{
417-
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
417+
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
418418
},
419419
},
420-
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.18.0"),
420+
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.18.0"),
421421
},
422422
{
423-
name: "vsphere platform, no existing config, no opt-in expected",
423+
name: "vsphere platform, no existing config, opt-in expected",
424424
infra: buildInfra(withPlatformType(configv1.VSpherePlatformType)),
425425
mcop: buildMachineConfigurationWithNoBootImageConfiguration(),
426426
clusterVersion: buildClusterVersion("4.18.0"),
427-
annotationExpected: false,
427+
annotationExpected: true,
428428
expectedManagedBootImagesStatus: opv1.ManagedBootImages{
429429
MachineManagers: []opv1.MachineManager{
430-
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
430+
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
431431
},
432432
},
433-
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.18.0"),
433+
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.18.0"),
434434
},
435435
{
436436
name: "bare metal platform, unsupported platform, no configuration expected",
@@ -488,15 +488,15 @@ func TestSyncMachineConfiguration(t *testing.T) {
488488
infra: buildInfra(withPlatformType(configv1.AzurePlatformType)),
489489
mcop: buildMachineConfigurationWithNoBootImageConfiguration(),
490490
clusterVersion: buildClusterVersion("4.18.0"),
491-
annotationExpected: false,
491+
annotationExpected: true,
492492
enableCPMSFeatureGate: true,
493493
expectedManagedBootImagesStatus: opv1.ManagedBootImages{
494494
MachineManagers: []opv1.MachineManager{
495-
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
495+
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
496496
{Resource: opv1.ControlPlaneMachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
497497
},
498498
},
499-
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.18.0"),
499+
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.18.0"),
500500
},
501501
{
502502
name: "AWS platform, CPMS enabled in spec, MachineSets should still follow platform default (All)",
@@ -514,19 +514,19 @@ func TestSyncMachineConfiguration(t *testing.T) {
514514
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.18.0"),
515515
},
516516
{
517-
name: "Azure platform, CPMS enabled in spec, MachineSets should still follow platform default (None)",
517+
name: "Azure platform, CPMS enabled in spec, MachineSets should still follow platform default (All)",
518518
infra: buildInfra(withPlatformType(configv1.AzurePlatformType)),
519519
mcop: buildMachineConfigurationWithCPMSEnabled(),
520520
clusterVersion: buildClusterVersion("4.18.0"),
521-
annotationExpected: false,
521+
annotationExpected: true,
522522
enableCPMSFeatureGate: true,
523523
expectedManagedBootImagesStatus: opv1.ManagedBootImages{
524524
MachineManagers: []opv1.MachineManager{
525-
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
525+
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
526526
{Resource: opv1.ControlPlaneMachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
527527
},
528528
},
529-
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.18.0"),
529+
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.18.0"),
530530
},
531531
{
532532
name: "AWS platform, MachineSets enabled in spec, CPMS should remain disabled (no opinion)",
@@ -618,14 +618,14 @@ func TestSyncMachineConfiguration(t *testing.T) {
618618
infra: buildInfra(withPlatformType(configv1.VSpherePlatformType)),
619619
mcop: buildMachineConfigurationWithNoBootImageConfiguration(),
620620
clusterVersion: buildClusterVersion("4.19.0"),
621-
annotationExpected: false,
621+
annotationExpected: true,
622622
enableCPMSFeatureGate: true,
623623
expectedManagedBootImagesStatus: opv1.ManagedBootImages{
624624
MachineManagers: []opv1.MachineManager{
625-
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.None}},
625+
{Resource: opv1.MachineSets, APIGroup: opv1.MachineAPI, Selection: opv1.MachineManagerSelector{Mode: opv1.All}},
626626
},
627627
},
628-
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusManualWithOCPVersion("4.19.0"),
628+
expectedSkewEnforcementStatus: apihelpers.GetSkewEnforcementStatusAutomaticWithOCPVersion("4.19.0"),
629629
},
630630
// Skew enforcement test cases
631631
{

test/extended-priv/mco_bootimages_skew.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive
124124
})
125125

126126
g.It("Verify Automatic mode and Upgradeable (Sad Case) [apigroup:machineconfiguration.openshift.io]", func(_ context.Context) {
127-
// only applicable on GCP, AWS clusters
128-
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform)
127+
// only applicable on clustres where we support automatic updates: A
128+
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform, AzurePlatform, VspherePlatform)
129129

130130
// No opinion on skew enforcement for these platforms will result in Automatic mode
131131
o.Expect(machineConfiguration.RemoveSkew()).To(o.Succeed())

0 commit comments

Comments
 (0)