Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,6 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
cloudproviderconfig := &CloudProviderConfig{}
dependencies.Get(clusterID, installConfig, cloudproviderconfig)

var platform configv1.PlatformType
switch installConfig.Config.Platform.Name() {
case aws.Name:
platform = configv1.AWSPlatformType
case none.Name:
platform = configv1.NonePlatformType
case libvirt.Name:
platform = configv1.LibvirtPlatformType
case openstack.Name:
platform = configv1.OpenStackPlatformType
case vsphere.Name:
platform = configv1.VSpherePlatformType
case azure.Name:
platform = configv1.AzurePlatformType
default:
platform = configv1.NonePlatformType
}

config := &configv1.Infrastructure{
TypeMeta: metav1.TypeMeta{
APIVersion: configv1.SchemeGroupVersion.String(),
Expand All @@ -82,13 +64,34 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
},
Status: configv1.InfrastructureStatus{
InfrastructureName: clusterID.InfraID,
Platform: platform,
APIServerURL: getInternalAPIServerURL(installConfig.Config),
APIServerInternalURL: getInternalAPIServerURL(installConfig.Config),
EtcdDiscoveryDomain: getEtcdDiscoveryDomain(installConfig.Config),
PlatformStatus: &configv1.PlatformStatus{},
},
}

switch installConfig.Config.Platform.Name() {
case aws.Name:
config.Status.PlatformStatus.Type = configv1.AWSPlatformType
config.Status.PlatformStatus.AWS = &configv1.AWSPlatformStatus{
Region: installConfig.Config.Platform.AWS.Region,
}
case none.Name:
config.Status.PlatformStatus.Type = configv1.NonePlatformType
case libvirt.Name:
config.Status.PlatformStatus.Type = configv1.LibvirtPlatformType
case openstack.Name:
config.Status.PlatformStatus.Type = configv1.OpenStackPlatformType
case vsphere.Name:
config.Status.PlatformStatus.Type = configv1.VSpherePlatformType
case azure.Name:
config.Status.PlatformStatus.Type = configv1.AzurePlatformType
Copy link

@dmage dmage May 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need LocationID for Azure, so that we know in which region we should create Storage Account.

default:
config.Status.PlatformStatus.Type = configv1.NonePlatformType
}
config.Status.Platform = config.Status.PlatformStatus.Type

if cloudproviderconfig.ConfigMap != nil {
// set the configmap reference.
config.Spec.CloudConfig = configv1.ConfigMapFileReference{Name: cloudproviderconfig.ConfigMap.Name, Key: cloudProviderConfigDataKey}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.