Skip to content

Commit

Permalink
Merge pull request openshift#1509 from wking/infrastructure-name
Browse files Browse the repository at this point in the history
pkg/asset/manifests/infrastructure: Set InfrastructureName
  • Loading branch information
openshift-merge-robot committed Apr 1, 2019
2 parents d89fb5f + 2bd24cd commit a552220
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 396 deletions.
8 changes: 4 additions & 4 deletions Gopkg.lock

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

17 changes: 10 additions & 7 deletions pkg/asset/manifests/infrastructure.go
Expand Up @@ -39,29 +39,31 @@ func (*Infrastructure) Name() string {
// the asset.
func (*Infrastructure) Dependencies() []asset.Asset {
return []asset.Asset{
&installconfig.ClusterID{},
&installconfig.InstallConfig{},
}
}

// Generate generates the Infrastructure config and its CRD.
func (i *Infrastructure) Generate(dependencies asset.Parents) error {
clusterID := &installconfig.ClusterID{}
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)
dependencies.Get(clusterID, installConfig)

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

config := &configv1.Infrastructure{
Expand All @@ -74,6 +76,7 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
// not namespaced
},
Status: configv1.InfrastructureStatus{
InfrastructureName: clusterID.InfraID,
Platform: platform,
APIServerURL: getAPIServerURL(installConfig.Config),
EtcdDiscoveryDomain: getEtcdDiscoveryDomain(installConfig.Config),
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/openshift/api/config/v1/register.go

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

3 changes: 0 additions & 3 deletions vendor/github.com/openshift/api/config/v1/types.go

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

1 change: 1 addition & 0 deletions vendor/github.com/openshift/api/config/v1/types_console.go

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.

41 changes: 25 additions & 16 deletions vendor/github.com/openshift/api/config/v1/types_infrastructure.go

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

26 changes: 3 additions & 23 deletions vendor/github.com/openshift/api/config/v1/types_oauth.go

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

21 changes: 21 additions & 0 deletions vendor/github.com/openshift/api/config/v1/types_scheduling.go

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

0 comments on commit a552220

Please sign in to comment.