diff --git a/internal/featuresupport/feature_support_test.go b/internal/featuresupport/feature_support_test.go index 1272ed00e9..ba8ee79400 100644 --- a/internal/featuresupport/feature_support_test.go +++ b/internal/featuresupport/feature_support_test.go @@ -182,7 +182,6 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { Expect(value).To(Equal(models.SupportLevelSupported)) } } - }) }) @@ -540,9 +539,7 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { Context("getIncompatibleFeatures", func() { It("Features without any restrictions", func() { features := []models.FeatureSupportLevelID{ - models.FeatureSupportLevelIDVIPAUTOALLOC, models.FeatureSupportLevelIDCUSTOMMANIFEST, - models.FeatureSupportLevelIDDUALSTACKVIPS, models.FeatureSupportLevelIDSINGLENODEEXPANSION, models.FeatureSupportLevelIDCNV, } @@ -551,6 +548,27 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { } }) + It("incompatibleFeatures - all features - no openshift version", func() { + for featureId, feature := range featuresList { + featureId := featureId + feature := feature + + incompatibleFeatures := feature.getIncompatibleFeatures("") + if incompatibleFeatures != nil { + for _, incompatibleFeatureId := range *incompatibleFeatures { + incompatibleFeature := featuresList[incompatibleFeatureId] + By(fmt.Sprintf("Feature %s with incompatible feature %s", featureId, incompatibleFeatureId), func() { + incompatibleFeatures2 := incompatibleFeature.getIncompatibleFeatures("") + if incompatibleFeatures2 == nil { + incompatibleFeatures2 = &[]models.FeatureSupportLevelID{} + } + Expect(*incompatibleFeatures2).To(ContainElement(featureId)) + }) + } + } + } + }) + It("vSphere with dual-stack", func() { dualStackFeature := featuresList[models.FeatureSupportLevelIDDUALSTACK] vsphereFeature := featuresList[models.FeatureSupportLevelIDVSPHEREINTEGRATION] @@ -565,61 +583,6 @@ var _ = Describe("V2ListFeatureSupportLevels API", func() { Expect(isDualStackIncompatibleWithVsphere).To(BeNil()) Expect(isVsphereIncompatibleWithDualStack).To(BeNil()) }) - - It("Features with restrictions - Nutanix and UserManagedNetworking", func() { - umnFeature := featuresList[models.FeatureSupportLevelIDUSERMANAGEDNETWORKING] - nutanixFeature := featuresList[models.FeatureSupportLevelIDNUTANIXINTEGRATION] - - isUmnIncompatibleWithNutanix := isFeatureCompatible("", umnFeature, nutanixFeature) - isNutanixIncompatibleWithUmn := isFeatureCompatible("", nutanixFeature, umnFeature) - - Expect((*isUmnIncompatibleWithNutanix).getId()).To(Equal(nutanixFeature.getId())) - Expect((*isNutanixIncompatibleWithUmn).getId()).To(Equal(umnFeature.getId())) - }) - - It("Features with restrictions - OCI and CMN", func() { - cmnFeature := featuresList[models.FeatureSupportLevelIDCLUSTERMANAGEDNETWORKING] - ociFeature := featuresList[models.FeatureSupportLevelIDEXTERNALPLATFORMOCI] - - isCmnIncompatibleWithOci := isFeatureCompatible("", cmnFeature, ociFeature) - isOciIncompatibleWithUmn := isFeatureCompatible("", ociFeature, cmnFeature) - - Expect((*isCmnIncompatibleWithOci).getId()).To(Equal(ociFeature.getId())) - Expect((*isOciIncompatibleWithUmn).getId()).To(Equal(cmnFeature.getId())) - }) - - It("Features with restrictions - OCI and Full ISO", func() { - fullIsoFeature := featuresList[models.FeatureSupportLevelIDFULLISO] - ociFeature := featuresList[models.FeatureSupportLevelIDEXTERNALPLATFORMOCI] - - isFullIsoIncompatibleWithOci := isFeatureCompatible("", fullIsoFeature, ociFeature) - isOciIncompatibleWithUmn := isFeatureCompatible("", ociFeature, fullIsoFeature) - - Expect((*isFullIsoIncompatibleWithOci).getId()).To(Equal(ociFeature.getId())) - Expect((*isOciIncompatibleWithUmn).getId()).To(Equal(fullIsoFeature.getId())) - }) - - It("Features with restrictions - Sno", func() { - snoFeature := featuresList[models.FeatureSupportLevelIDSNO] - nutanixFeature := featuresList[models.FeatureSupportLevelIDNUTANIXINTEGRATION] - vsphereFeature := featuresList[models.FeatureSupportLevelIDVSPHEREINTEGRATION] - cmnFeature := featuresList[models.FeatureSupportLevelIDCLUSTERMANAGEDNETWORKING] - - isSnoIncompatibleWithNutanix := isFeatureCompatible("", snoFeature, nutanixFeature) - isSnoIncompatibleWithVsphere := isFeatureCompatible("", snoFeature, vsphereFeature) - isSnoIncompatibleWithCmn := isFeatureCompatible("", snoFeature, cmnFeature) - - isNutanixIncompatibleWithSno := isFeatureCompatible("", nutanixFeature, snoFeature) - isVsphereIncompatibleWithSno := isFeatureCompatible("", vsphereFeature, snoFeature) - isCmnIncompatibleWithSno := isFeatureCompatible("", cmnFeature, snoFeature) - - Expect((*isSnoIncompatibleWithNutanix).getId()).To(Equal(nutanixFeature.getId())) - Expect((*isSnoIncompatibleWithVsphere).getId()).To(Equal(vsphereFeature.getId())) - Expect((*isSnoIncompatibleWithCmn).getId()).To(Equal(cmnFeature.getId())) - Expect((*isNutanixIncompatibleWithSno).getId()).To(Equal(snoFeature.getId())) - Expect((*isVsphereIncompatibleWithSno).getId()).To(Equal(snoFeature.getId())) - Expect((*isCmnIncompatibleWithSno).getId()).To(Equal(snoFeature.getId())) - }) }) }) }) diff --git a/internal/featuresupport/features.go b/internal/featuresupport/features.go index bb7000f33f..6c15be348c 100644 --- a/internal/featuresupport/features.go +++ b/internal/featuresupport/features.go @@ -146,7 +146,11 @@ func (feature *VipAutoAllocFeature) getSupportLevel(_ SupportLevelFilters) model } func (feature *VipAutoAllocFeature) getIncompatibleFeatures(string) *[]models.FeatureSupportLevelID { - return nil + return &[]models.FeatureSupportLevelID{ + models.FeatureSupportLevelIDSNO, + models.FeatureSupportLevelIDEXTERNALPLATFORMOCI, + models.FeatureSupportLevelIDLVM, + } } func (feature *VipAutoAllocFeature) getIncompatibleArchitectures(_ *string) *[]models.ArchitectureSupportLevelID { @@ -262,6 +266,7 @@ func (feature *ClusterManagedNetworkingFeature) getIncompatibleFeatures(string) models.FeatureSupportLevelIDSNO, models.FeatureSupportLevelIDUSERMANAGEDNETWORKING, models.FeatureSupportLevelIDEXTERNALPLATFORMOCI, + models.FeatureSupportLevelIDLVM, } } @@ -354,7 +359,9 @@ func (feature *DualStackVipsFeature) getFeatureActiveLevel(cluster *common.Clust } func (feature *DualStackVipsFeature) getIncompatibleFeatures(string) *[]models.FeatureSupportLevelID { - return nil + return &[]models.FeatureSupportLevelID{ + models.FeatureSupportLevelIDEXTERNALPLATFORMOCI, + } } func (feature *DualStackVipsFeature) getIncompatibleArchitectures(_ *string) *[]models.ArchitectureSupportLevelID { @@ -553,6 +560,7 @@ func (feature *NutanixIntegrationFeature) getIncompatibleFeatures(string) *[]mod models.FeatureSupportLevelIDSNO, models.FeatureSupportLevelIDUSERMANAGEDNETWORKING, models.FeatureSupportLevelIDLVM, + models.FeatureSupportLevelIDMCE, } }