Skip to content

Commit 8e91b85

Browse files
Merge pull request #5583 from djoshy/azure-vsphere-opt-out
MCO-2036: Enable boot image updates by default for vsphere and Azure
2 parents 9aeb81d + d98db2f commit 8e91b85

6 files changed

Lines changed: 52 additions & 34 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.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/longdurati
6060

6161
})
6262

63-
g.It("[PolarionID:81403][OTP] In BootImages Machineset should update by default", g.Label("Platform:aws", "Platform:gcp"), func() {
63+
g.It("[PolarionID:81403][OTP] In BootImages Machineset should update by default", g.Label("Platform:aws", "Platform:gcp", "Platform:vsphere", "Platform:azure"), func() {
6464

6565
// Not supported in Vsphere
66-
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform)
66+
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform, VspherePlatform, AzurePlatform)
6767

6868
var (
6969
duplicatedMachinesetName = fmt.Sprintf("cloned-tc-%s", GetCurrentTestPolarionIDNumber())
@@ -471,10 +471,10 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/longdurati
471471
testUserDataUpdateFailure(oc, clonedMSName, clonedSecretName, expectedFailedMessageRegexp, setWrongIgnitionVersion)
472472
})
473473

474-
g.It("[PolarionID:81395][OTP] Verify in boot-image by default update is opt-in", g.Label("Platform:aws", "Platform:gcp"), func() {
474+
g.It("[PolarionID:81395][OTP] Verify in boot-image by default update is opt-in", g.Label("Platform:aws", "Platform:gcp", "Platform:vsphere", "Platform:azure"), func() {
475475

476476
// Not supported in Vsphere
477-
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform)
477+
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform, VspherePlatform, AzurePlatform)
478478

479479
exutil.By("To check the default opt-in in machieconfiguration")
480480
if !strings.Contains(machineConfiguration.GetSpecOrFail(), "managedBootImages") {

test/extended-priv/mco_bootimages_skew.go

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

9191
g.It("Verify Automatic mode and Upgradeable (Happy Case) [apigroup:machineconfiguration.openshift.io]", func() {
92-
// only applicable on GCP, AWS clusters
93-
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform)
92+
// only applicable on clusters where we support automatic updates: GCP, AWS, Azure and vSphere
93+
skipTestIfSupportedPlatformNotMatched(oc, GCPPlatform, AWSPlatform, AzurePlatform, VspherePlatform)
9494

9595
// No opinion on skew enforcement for these platforms will result in Automatic mode
9696
o.Expect(machineConfiguration.RemoveSkew()).To(o.Succeed())
@@ -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 clusters where we support automatic updates: GCP, AWS, Azure and vSphere
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())
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: template.openshift.io/v1
2+
kind: Template
3+
metadata:
4+
name: skewenforcement-none
5+
objects:
6+
- apiVersion: operator.openshift.io/v1
7+
kind: MachineConfiguration
8+
metadata:
9+
name: cluster
10+
namespace: openshift-machine-config-operator
11+
spec:
12+
logLevel: Normal
13+
operatorLogLevel: Normal
14+
bootImageSkewEnforcement:
15+
mode: None

test/extended/boot_image_update_azure.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ import (
2121
var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive][Serial][OCPFeatureGate:ManagedBootImagesAzure]", g.Label("Platform:azure"), g.Ordered, func() {
2222
defer g.GinkgoRecover()
2323
var (
24-
AllMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-all.yaml")
25-
NoneMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-none.yaml")
26-
PartialMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-partial.yaml")
27-
EmptyMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-empty.yaml")
24+
AllMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-all.yaml")
25+
NoneMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-none.yaml")
26+
PartialMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-partial.yaml")
27+
EmptyMachineSetFixture = filepath.Join("machineconfigurations", "managedbootimages-empty.yaml")
28+
SkewEnforcementDisabledFixture = filepath.Join("machineconfigurations", "skewenforcement-disabled.yaml")
2829

2930
oc = exutil.NewCLI("mco-bootimage", exutil.KubeConfigPath()).AsAdmin()
3031
)
@@ -36,6 +37,8 @@ var _ = g.Describe("[sig-mco][Suite:openshift/machine-config-operator/disruptive
3637
skipUnlessFunctionalMachineAPI(oc)
3738
// Skip this test on single node platforms
3839
exutil.SkipOnSingleNodeTopology(oc)
40+
// Disable boot image skew enforcement
41+
applyMachineConfigurationFixture(oc, SkewEnforcementDisabledFixture)
3942
})
4043

4144
g.AfterEach(func() {

0 commit comments

Comments
 (0)