Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-16303: Disable skip MCO reboot for architecture s390x #5765

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion internal/featuresupport/features_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ func (f *skipMcoReboot) GetName() string {
}

func (f *skipMcoReboot) getSupportLevel(filters SupportLevelFilters) models.SupportLevel {
if !isFeatureCompatibleWithArchitecture(f, filters.OpenshiftVersion, swag.StringValue(filters.CPUArchitecture)) {
return models.SupportLevelUnavailable
}
enableSkipMcoReboot, err := common.BaseVersionGreaterOrEqual("4.15.0", filters.OpenshiftVersion)
if !enableSkipMcoReboot || err != nil {
return models.SupportLevelUnavailable
Expand All @@ -278,7 +281,9 @@ func (f *skipMcoReboot) getIncompatibleFeatures(openshiftVersion string) *[]mode
}

func (f *skipMcoReboot) getIncompatibleArchitectures(openshiftVersion *string) *[]models.ArchitectureSupportLevelID {
return nil
return &[]models.ArchitectureSupportLevelID{
models.ArchitectureSupportLevelIDS390XARCHITECTURE,
}
}

func (f *skipMcoReboot) getFeatureActiveLevel(cluster *common.Cluster, infraEnv *models.InfraEnv,
Expand Down
21 changes: 14 additions & 7 deletions internal/host/hostcommands/install_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,27 @@ var _ = Describe("installcmd", func() {
})
})
DescribeTable("enable MCO reboot values",
func(enableMcoReboot bool, version string, expected bool) {
func(enableMcoReboot bool, version string, architecture string, expected bool) {
installCommand := NewInstallCmd(common.GetTestLog(), db, mockValidator, mockRelease, instructionConfig, mockEvents, mockVersions, enableMcoReboot)
mockValidator.EXPECT().GetHostInstallationPath(gomock.Any()).Return(common.TestDiskId).Times(1)
mockGetReleaseImage(1)
mockImages(1)
Expect(db.Model(&common.Cluster{}).Where("id = ?", *host.ClusterID).Update("openshift_version", version).Error).ToNot(HaveOccurred())
Expect(db.Model(&common.Cluster{}).Where("id = ?", *host.ClusterID).Updates(map[string]interface{}{
"openshift_version": version,
"cpu_architecture": architecture,
}).Error).ToNot(HaveOccurred())
installCmdSteps, stepErr = installCommand.GetSteps(ctx, &host)
validateInstallCommand(installCommand, installCmdSteps[0], models.HostRoleMaster, infraEnvId, clusterId, *host.ID, common.TestDiskId, nil, models.ClusterHighAvailabilityModeFull, expected, version)
},
Entry("Enbale MCO reboot is false", false, "4.15.0", false),
Entry("Enbale MCO reboot is true. Lower version", true, "4.14.0", false),
Entry("Enbale MCO reboot is true. Equal version", true, "4.15.0", true),
Entry("Enbale MCO reboot is true. Higher version", true, "4.16.0", true),
Entry("Enbale MCO reboot is true. Empty version", true, "", false),
Entry("Enbale MCO reboot is false", false, "4.15.0", models.ClusterCPUArchitectureX8664, false),
Entry("Enbale MCO reboot is true. Lower version", true, "4.14.0", models.ClusterCPUArchitectureX8664, false),
Entry("Enbale MCO reboot is true. Equal version", true, "4.15.0", models.ClusterCPUArchitectureX8664, true),
Entry("Enbale MCO reboot is true. Empty version", true, "", models.ClusterCPUArchitectureX8664, false),
Entry("Enbale MCO reboot is true. Higher version - x86_64", true, "4.16.0", models.ClusterCPUArchitectureX8664, true),
Entry("Enbale MCO reboot is true. Higher version - aarch64", true, "4.16.0", models.ClusterCPUArchitectureAarch64, true),
Entry("Enbale MCO reboot is true. Higher version - arm64", true, "4.16.0", models.ClusterCPUArchitectureArm64, true),
Entry("Enbale MCO reboot is true. Higher version - ppc64le", true, "4.16.0", models.ClusterCPUArchitecturePpc64le, true),
Entry("Enbale MCO reboot is true. Higher version - s390x", true, "4.16.0", models.ClusterCPUArchitectureS390x, false),
)

It("get_step_one_master_success", func() {
Expand Down