Skip to content

Commit f1e31c8

Browse files
Pass rhcosImage and manifests to the PreProvision hook
OpenStack in particular needs: * to upload the RHCOS image to the OpenStack image registry * to change how security groups are set, depending on whether Control plane nodes are schedulable Both operations happen in the PreProvision hook in the case of OpenStack, because CAPO is not (yet) capable of performing them.
1 parent 45a3d25 commit f1e31c8

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

pkg/infrastructure/clusterapi/clusterapi.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import (
2323
"github.com/openshift/installer/pkg/asset/installconfig"
2424
"github.com/openshift/installer/pkg/asset/kubeconfig"
2525
"github.com/openshift/installer/pkg/asset/machines"
26+
"github.com/openshift/installer/pkg/asset/manifests"
2627
"github.com/openshift/installer/pkg/asset/manifests/capiutils"
2728
capimanifests "github.com/openshift/installer/pkg/asset/manifests/clusterapi"
29+
"github.com/openshift/installer/pkg/asset/rhcos"
2830
"github.com/openshift/installer/pkg/clusterapi"
2931
"github.com/openshift/installer/pkg/infrastructure"
3032
"github.com/openshift/installer/pkg/types"
@@ -52,18 +54,22 @@ func InitializeProvider(platform Provider) infrastructure.Provider {
5254
//
5355
//nolint:gocyclo
5456
func (i *InfraProvider) Provision(dir string, parents asset.Parents) ([]*asset.File, error) {
57+
manifestsAsset := &manifests.Manifests{}
5558
capiManifestsAsset := &capimanifests.Cluster{}
5659
capiMachinesAsset := &machines.ClusterAPI{}
5760
clusterKubeconfigAsset := &kubeconfig.AdminClient{}
5861
clusterID := &installconfig.ClusterID{}
5962
installConfig := &installconfig.InstallConfig{}
63+
rhcosImage := new(rhcos.Image)
6064
bootstrapIgnAsset := &bootstrap.Bootstrap{}
6165
masterIgnAsset := &machine.Master{}
6266
parents.Get(
67+
manifestsAsset,
6368
capiManifestsAsset,
6469
clusterKubeconfigAsset,
6570
clusterID,
6671
installConfig,
72+
rhcosImage,
6773
bootstrapIgnAsset,
6874
masterIgnAsset,
6975
capiMachinesAsset,
@@ -96,8 +102,10 @@ func (i *InfraProvider) Provision(dir string, parents asset.Parents) ([]*asset.F
96102

97103
if p, ok := i.impl.(PreProvider); ok {
98104
preProvisionInput := PreProvisionInput{
99-
InfraID: clusterID.InfraID,
100-
InstallConfig: installConfig,
105+
InfraID: clusterID.InfraID,
106+
InstallConfig: installConfig,
107+
RhcosImage: rhcosImage,
108+
ManifestsAsset: manifestsAsset,
101109
}
102110

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

pkg/infrastructure/clusterapi/types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ 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/manifests"
10+
"github.com/openshift/installer/pkg/asset/rhcos"
911
)
1012

1113
// Provider is the base interface that cloud platforms
@@ -26,8 +28,10 @@ type PreProvider interface {
2628

2729
// PreProvisionInput collects the args passed to the PreProvision call.
2830
type PreProvisionInput struct {
29-
InfraID string
30-
InstallConfig *installconfig.InstallConfig
31+
InfraID string
32+
InstallConfig *installconfig.InstallConfig
33+
RhcosImage *rhcos.Image
34+
ManifestsAsset *manifests.Manifests
3135
}
3236

3337
// IgnitionProvider handles preconditions for bootstrap ignition and

0 commit comments

Comments
 (0)