Skip to content

Commit

Permalink
MGMT-16739: CNV and MCE should be disabled when select platform Nutan…
Browse files Browse the repository at this point in the history
…ix (#5941)
  • Loading branch information
danmanor committed Feb 4, 2024
1 parent f4dd8a1 commit 99a3b96
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
38 changes: 37 additions & 1 deletion internal/featuresupport/feature_support_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,43 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() {
err := ValidateIncompatibleFeatures(log, models.ClusterCPUArchitectureS390x, &cluster, &infraEnv, nil)
Expect(err).To(Not(BeNil()))
})
It("Nutanix is activated with incompatible features - fail", func() {
operatorsCNV := []*models.MonitoredOperator{
{
Name: "cnv",
Namespace: "openshift-cnv",
OperatorType: models.OperatorTypeOlm,
SubscriptionName: "hco-operatorhub",
TimeoutSeconds: 60 * 60,
},
}
cluster := common.Cluster{Cluster: models.Cluster{
OpenshiftVersion: "4.14",
CPUArchitecture: models.ClusterCPUArchitectureX8664,
Platform: &models.Platform{Type: common.PlatformTypePtr(models.PlatformTypeNutanix)},
MonitoredOperators: operatorsCNV,
}}
err := ValidateIncompatibleFeatures(log, models.ClusterCPUArchitectureX8664, &cluster, nil, nil)
Expect(err).To(HaveOccurred())

operatorsMCE := []*models.MonitoredOperator{
{
Name: "mce",
OperatorType: models.OperatorTypeOlm,
Namespace: "multicluster-engine",
SubscriptionName: "multicluster-engine",
TimeoutSeconds: 60 * 60,
},
}
cluster = common.Cluster{Cluster: models.Cluster{
OpenshiftVersion: "4.14",
CPUArchitecture: models.ClusterCPUArchitectureX8664,
Platform: &models.Platform{Type: common.PlatformTypePtr(models.PlatformTypeNutanix)},
MonitoredOperators: operatorsMCE,
}}
err = ValidateIncompatibleFeatures(log, models.ClusterCPUArchitectureX8664, &cluster, nil, nil)
Expect(err).To(HaveOccurred())
})
})

Context("Incompatibilities", func() {
Expand Down Expand Up @@ -667,7 +704,6 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() {
features := []models.FeatureSupportLevelID{
models.FeatureSupportLevelIDCUSTOMMANIFEST,
models.FeatureSupportLevelIDSINGLENODEEXPANSION,
models.FeatureSupportLevelIDCNV,
}
for _, featureId := range features {
Expect(featuresList[featureId].getIncompatibleFeatures("")).To(BeNil())
Expand Down
4 changes: 3 additions & 1 deletion internal/featuresupport/features_olm_operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ func (feature *CnvFeature) getSupportLevel(filters SupportLevelFilters) models.S
}

func (feature *CnvFeature) getIncompatibleFeatures(string) *[]models.FeatureSupportLevelID {
return nil
return &[]models.FeatureSupportLevelID{
models.FeatureSupportLevelIDNUTANIXINTEGRATION,
}
}

func (feature *CnvFeature) getIncompatibleArchitectures(_ *string) *[]models.ArchitectureSupportLevelID {
Expand Down
1 change: 0 additions & 1 deletion internal/featuresupport/features_olm_operators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() {
for _, feature := range features {
Expect(isFeatureCompatible("4.15", featuresList[feature], lvmFeatureList)).To(BeNil())
}

})
})
})
1 change: 1 addition & 0 deletions internal/featuresupport/features_platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func (feature *NutanixIntegrationFeature) getIncompatibleFeatures(string) *[]mod
models.FeatureSupportLevelIDUSERMANAGEDNETWORKING,
models.FeatureSupportLevelIDLVM,
models.FeatureSupportLevelIDMCE,
models.FeatureSupportLevelIDCNV,
models.FeatureSupportLevelIDPLATFORMMANAGEDNETWORKING,
}
}
Expand Down

0 comments on commit 99a3b96

Please sign in to comment.