Skip to content

Commit 330a794

Browse files
clusterapi: Add worker asset to PreProvision
This is needed by OpenStack to provision the server group for workers in the CAPI flow, based on the manifests potentially modified by the user.
1 parent 304af67 commit 330a794

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

pkg/asset/cluster/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func (c *Cluster) Dependencies() []asset.Asset {
7070
&kubeconfig.AdminClient{},
7171
&bootstrap.Bootstrap{},
7272
&machine.Master{},
73+
&machines.Worker{},
7374
&machines.ClusterAPI{},
7475
new(rhcos.Image),
7576
&manifests.Manifests{},

pkg/infrastructure/clusterapi/clusterapi.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func InitializeProvider(platform Provider) infrastructure.Provider {
5858
//nolint:gocyclo
5959
func (i *InfraProvider) Provision(dir string, parents asset.Parents) ([]*asset.File, error) {
6060
manifestsAsset := &manifests.Manifests{}
61+
workersAsset := &machines.Worker{}
6162
capiManifestsAsset := &capimanifests.Cluster{}
6263
capiMachinesAsset := &machines.ClusterAPI{}
6364
clusterKubeconfigAsset := &kubeconfig.AdminClient{}
@@ -68,6 +69,7 @@ func (i *InfraProvider) Provision(dir string, parents asset.Parents) ([]*asset.F
6869
masterIgnAsset := &machine.Master{}
6970
parents.Get(
7071
manifestsAsset,
72+
workersAsset,
7173
capiManifestsAsset,
7274
clusterKubeconfigAsset,
7375
clusterID,
@@ -110,6 +112,7 @@ func (i *InfraProvider) Provision(dir string, parents asset.Parents) ([]*asset.F
110112
RhcosImage: rhcosImage,
111113
ManifestsAsset: manifestsAsset,
112114
MachineManifests: machineManifests,
115+
WorkersAsset: workersAsset,
113116
}
114117

115118
if err := p.PreProvision(ctx, preProvisionInput); err != nil {

pkg/infrastructure/clusterapi/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"sigs.k8s.io/controller-runtime/pkg/client"
77

88
"github.com/openshift/installer/pkg/asset/installconfig"
9+
"github.com/openshift/installer/pkg/asset/machines"
910
"github.com/openshift/installer/pkg/asset/manifests"
1011
"github.com/openshift/installer/pkg/asset/rhcos"
1112
)
@@ -33,6 +34,7 @@ type PreProvisionInput struct {
3334
RhcosImage *rhcos.Image
3435
ManifestsAsset *manifests.Manifests
3536
MachineManifests []client.Object
37+
WorkersAsset *machines.Worker
3638
}
3739

3840
// IgnitionProvider handles preconditions for bootstrap ignition and

0 commit comments

Comments
 (0)