Skip to content

Commit

Permalink
MGMT-14781: Make LSO operator to support all CPU architectures (#5262)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliorerz committed May 31, 2023
1 parent 10eaceb commit 9e2b061
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 24 additions & 0 deletions internal/featuresupport/feature_support_test.go
Expand Up @@ -112,6 +112,30 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() {
}
})

Context("Test LSO CPU compatibility", func() {
feature := models.FeatureSupportLevelIDLSO
It("LSO IsFeatureAvailable", func() {
Expect(IsFeatureAvailable(feature, "Does not matter", swag.String(models.ClusterCPUArchitecturePpc64le))).To(Equal(true))
Expect(IsFeatureAvailable(feature, "Does not matter", swag.String(models.ClusterCPUArchitectureX8664))).To(Equal(true))
Expect(IsFeatureAvailable(feature, "Does not matter", swag.String(models.ClusterCPUArchitectureS390x))).To(Equal(true))
Expect(IsFeatureAvailable(feature, "Does not matter", swag.String(models.ClusterCPUArchitectureArm64))).To(Equal(false))
})
It("LSO GetSupportLevel on architecture", func() {
featureSupportParams := SupportLevelFilters{OpenshiftVersion: "Any", CPUArchitecture: swag.String(models.ClusterCPUArchitectureX8664)}
Expect(GetSupportLevel(feature, featureSupportParams)).To(Equal(models.SupportLevelSupported))

featureSupportParams.CPUArchitecture = swag.String(models.ClusterCPUArchitectureS390x)
Expect(GetSupportLevel(feature, featureSupportParams)).To(Equal(models.SupportLevelSupported))

featureSupportParams.CPUArchitecture = swag.String(models.ClusterCPUArchitecturePpc64le)
Expect(GetSupportLevel(feature, featureSupportParams)).To(Equal(models.SupportLevelSupported))

featureSupportParams.CPUArchitecture = swag.String(models.ClusterCPUArchitectureArm64)
Expect(GetSupportLevel(feature, featureSupportParams)).To(Equal(models.SupportLevelUnavailable))
})

})

Context("GetCpuArchitectureSupportList", func() {
It("GetCpuArchitectureSupportList for openshift version 4.6", func() {
openshiftVersion := "4.6"
Expand Down
2 changes: 0 additions & 2 deletions internal/featuresupport/features.go
Expand Up @@ -678,8 +678,6 @@ func (feature *LsoFeature) getIncompatibleFeatures() *[]models.FeatureSupportLev

func (feature *LsoFeature) getIncompatibleArchitectures(_ *string) *[]models.ArchitectureSupportLevelID {
return &[]models.ArchitectureSupportLevelID{
models.ArchitectureSupportLevelIDS390XARCHITECTURE,
models.ArchitectureSupportLevelIDPPC64LEARCHITECTURE,
models.ArchitectureSupportLevelIDARM64ARCHITECTURE,
}
}
Expand Down

0 comments on commit 9e2b061

Please sign in to comment.