Skip to content

Commit ce0ab5d

Browse files
committed
include template in the faiure domain topology
1 parent f885428 commit ce0ab5d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

pkg/asset/manifests/infrastructure.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
245245
}
246246
}
247247

248-
config.Spec.PlatformSpec.VSphere = vsphereinfra.GetInfraPlatformSpec(installConfig)
249-
248+
config.Spec.PlatformSpec.VSphere = vsphereinfra.GetInfraPlatformSpec(installConfig, clusterID.InfraID)
250249
if _, exists := cloudproviderconfig.ConfigMap.Data["vsphere.conf"]; exists {
251250
cloudProviderConfigMapKey = "vsphere.conf"
252251
}

pkg/asset/manifests/vsphere/infrastructure.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package vsphere
22

33
import (
4+
"fmt"
5+
46
configv1 "github.com/openshift/api/config/v1"
57
"github.com/openshift/installer/pkg/asset/installconfig"
68
)
79

810
// GetInfraPlatformSpec constructs VSpherePlatformSpec for the infrastructure spec
9-
func GetInfraPlatformSpec(ic *installconfig.InstallConfig) *configv1.VSpherePlatformSpec {
11+
func GetInfraPlatformSpec(ic *installconfig.InstallConfig, clusterID string) *configv1.VSpherePlatformSpec {
1012
var platformSpec configv1.VSpherePlatformSpec
1113
icPlatformSpec := ic.Config.VSphere
1214

@@ -21,6 +23,11 @@ func GetInfraPlatformSpec(ic *installconfig.InstallConfig) *configv1.VSpherePlat
2123
for _, failureDomain := range icPlatformSpec.FailureDomains {
2224
topology := failureDomain.Topology
2325
if topology.ComputeCluster != "" && topology.Networks[0] != "" {
26+
template := topology.Template
27+
if len(template) == 0 {
28+
template = fmt.Sprintf("/%s/vm/%s-rhcos-%s-%s", topology.Datacenter, clusterID, failureDomain.Region, failureDomain.Zone)
29+
}
30+
2431
platformSpec.FailureDomains = append(platformSpec.FailureDomains, configv1.VSpherePlatformFailureDomainSpec{
2532
Name: failureDomain.Name,
2633
Region: failureDomain.Region,
@@ -33,6 +40,7 @@ func GetInfraPlatformSpec(ic *installconfig.InstallConfig) *configv1.VSpherePlat
3340
Datastore: topology.Datastore,
3441
ResourcePool: topology.ResourcePool,
3542
Folder: topology.Folder,
43+
Template: template,
3644
},
3745
})
3846
}

0 commit comments

Comments
 (0)