Skip to content

Commit 2bfb3d1

Browse files
committed
Use PreProvision
Move to the PreProvision interface to pre-create the required vsphere infrastructure components prior to capi/capv running.
1 parent 55344c0 commit 2bfb3d1

File tree

18 files changed

+636
-720
lines changed

18 files changed

+636
-720
lines changed

pkg/asset/cluster/cluster.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/openshift/installer/pkg/asset/cluster/azure"
1515
"github.com/openshift/installer/pkg/asset/cluster/openstack"
1616
"github.com/openshift/installer/pkg/asset/cluster/tfvars"
17-
vcentercontexts "github.com/openshift/installer/pkg/asset/cluster/vsphere"
1817
"github.com/openshift/installer/pkg/asset/ignition/bootstrap"
1918
"github.com/openshift/installer/pkg/asset/ignition/machine"
2019
"github.com/openshift/installer/pkg/asset/installconfig"
@@ -62,7 +61,6 @@ func (c *Cluster) Dependencies() []asset.Asset {
6261
&installconfig.PlatformCredsCheck{},
6362
&installconfig.PlatformPermsCheck{},
6463
&installconfig.PlatformProvisionCheck{},
65-
&vcentercontexts.VCenterContexts{},
6664
&quota.PlatformQuotaCheck{},
6765
&tfvars.TerraformVariables{},
6866
&password.KubeadminPassword{},

pkg/asset/cluster/vsphere/context.go

Lines changed: 0 additions & 208 deletions
This file was deleted.

pkg/asset/cluster/vsphere/vsphere.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ func Metadata(config *types.InstallConfig) *typesvsphere.Metadata {
1111

1212
// Since currently we only support a single vCenter
1313
// just use the first entry in the VCenters slice.
14-
1514
return &typesvsphere.Metadata{
1615
VCenter: config.VSphere.VCenters[0].Server,
1716
Username: config.VSphere.VCenters[0].Username,

pkg/asset/installconfig/installconfig.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type InstallConfig struct {
3434
Azure *icazure.Metadata `json:"azure,omitempty"`
3535
IBMCloud *icibmcloud.Metadata `json:"ibmcloud,omitempty"`
3636
PowerVS *icpowervs.Metadata `json:"powervs,omitempty"`
37+
VSphere *icvsphere.Metadata `json:"vsphere,omitempty"`
3738
}
3839

3940
var _ asset.WritableAsset = (*InstallConfig)(nil)
@@ -152,6 +153,13 @@ func (a *InstallConfig) finish(filename string) error {
152153
if a.Config.PowerVS != nil {
153154
a.PowerVS = icpowervs.NewMetadata(a.Config.BaseDomain)
154155
}
156+
if a.Config.VSphere != nil {
157+
a.VSphere = icvsphere.NewMetadata()
158+
159+
for _, v := range a.Config.VSphere.VCenters {
160+
_ = a.VSphere.AddCredentials(v.Server, v.Username, v.Password)
161+
}
162+
}
155163

156164
if err := validation.ValidateInstallConfig(a.Config, false).ToAggregate(); err != nil {
157165
if filename == "" {

0 commit comments

Comments
 (0)