@@ -6,7 +6,7 @@ package platform
66import (
77 "fmt"
88
9- configv1 "github.com/openshift/api/config/v1 "
9+ "github.com/openshift/api/features "
1010 "github.com/openshift/installer/pkg/infrastructure"
1111 awscapi "github.com/openshift/installer/pkg/infrastructure/aws/clusterapi"
1212 awsinfra "github.com/openshift/installer/pkg/infrastructure/aws/sdk"
@@ -30,6 +30,7 @@ import (
3030 "github.com/openshift/installer/pkg/terraform/stages/ovirt"
3131 "github.com/openshift/installer/pkg/terraform/stages/powervs"
3232 "github.com/openshift/installer/pkg/terraform/stages/vsphere"
33+ "github.com/openshift/installer/pkg/types"
3334 awstypes "github.com/openshift/installer/pkg/types/aws"
3435 azuretypes "github.com/openshift/installer/pkg/types/azure"
3536 baremetaltypes "github.com/openshift/installer/pkg/types/baremetal"
@@ -50,15 +51,15 @@ import (
5051func ProviderForPlatform (platform string , fg featuregates.FeatureGate ) (infrastructure.Provider , error ) {
5152 switch platform {
5253 case awstypes .Name :
53- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
54+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
5455 return clusterapi .InitializeProvider (& awscapi.Provider {}), nil
5556 }
56- if fg .Enabled (configv1 .FeatureGateInstallAlternateInfrastructureAWS ) {
57+ if fg .Enabled (features .FeatureGateInstallAlternateInfrastructureAWS ) {
5758 return awsinfra .InitializeProvider (), nil
5859 }
5960 return terraform .InitializeProvider (aws .PlatformStages ), nil
6061 case azuretypes .Name :
61- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
62+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
6263 return clusterapi .InitializeProvider (& azureinfra.Provider {}), nil
6364 }
6465 return terraform .InitializeProvider (azure .PlatformStages ), nil
@@ -67,36 +68,36 @@ func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastr
6768 case baremetaltypes .Name :
6869 return baremetalinfra .InitializeProvider (), nil
6970 case gcptypes .Name :
70- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
71+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
7172 return clusterapi .InitializeProvider (gcpcapi.Provider {}), nil
7273 }
7374 return terraform .InitializeProvider (gcp .PlatformStages ), nil
7475 case ibmcloudtypes .Name :
75- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
76+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
7677 return clusterapi .InitializeProvider (ibmcloudcapi.Provider {}), nil
7778 }
7879 return terraform .InitializeProvider (ibmcloud .PlatformStages ), nil
7980 case libvirttypes .Name :
8081 return terraform .InitializeProvider (libvirt .PlatformStages ), nil
8182 case nutanixtypes .Name :
82- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
83+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
8384 return clusterapi .InitializeProvider (nutanixcapi.Provider {}), nil
8485 }
8586 return terraform .InitializeProvider (nutanix .PlatformStages ), nil
8687 case powervstypes .Name :
87- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
88+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
8889 return clusterapi .InitializeProvider (& powervscapi.Provider {}), nil
8990 }
9091 return terraform .InitializeProvider (powervs .PlatformStages ), nil
9192 case openstacktypes .Name :
92- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
93+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
9394 return clusterapi .InitializeProvider (openstackcapi.Provider {}), nil
9495 }
9596 return terraform .InitializeProvider (openstack .PlatformStages ), nil
9697 case ovirttypes .Name :
9798 return terraform .InitializeProvider (ovirt .PlatformStages ), nil
9899 case vspheretypes .Name :
99- if fg . Enabled ( configv1 . FeatureGateClusterAPIInstall ) {
100+ if types . ClusterAPIFeatureGateEnabled ( platform , fg ) {
100101 return clusterapi .InitializeProvider (vspherecapi.Provider {}), nil
101102 }
102103 return terraform .InitializeProvider (vsphere .PlatformStages ), nil
0 commit comments