github.com/openshift/installer@v1.4.17/pkg/asset/manifests/external/infrastructure.go (about) 1 package external 2 3 import ( 4 configv1 "github.com/openshift/api/config/v1" 5 "github.com/openshift/installer/pkg/asset/installconfig" 6 "github.com/openshift/installer/pkg/types/external" 7 ) 8 9 // GetInfraPlatformSpec constructs ExternalPlatformSpec for the infrastructure spec. 10 func GetInfraPlatformSpec(ic *installconfig.InstallConfig) *configv1.ExternalPlatformSpec { 11 icPlatformSpec := ic.Config.External 12 13 return &configv1.ExternalPlatformSpec{ 14 PlatformName: icPlatformSpec.PlatformName, 15 } 16 } 17 18 // GetInfraPlatformStatus constructs ExternalPlatformSpec for the infrastructure spec. 19 func GetInfraPlatformStatus(ic *installconfig.InstallConfig) *configv1.ExternalPlatformStatus { 20 icPlatformSpec := ic.Config.External 21 22 var ccmState configv1.CloudControllerManagerState 23 24 switch icPlatformSpec.CloudControllerManager { 25 case external.CloudControllerManagerTypeExternal: 26 ccmState = configv1.CloudControllerManagerExternal 27 default: 28 ccmState = configv1.CloudControllerManagerNone 29 } 30 31 return &configv1.ExternalPlatformStatus{ 32 CloudControllerManager: configv1.CloudControllerManagerStatus{ 33 State: ccmState, 34 }, 35 } 36 }