Skip to content

Commit a6fe985

Browse files
committed
CORS-3281: IBMCloud: initial CAPI infrastructure
Adds the initial provider and infrastructure framework for the IBM Cloud CAPI install process. Related: https://issues.redhat.com/browse/CORS-3281
1 parent b569901 commit a6fe985

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package clusterapi
2+
3+
import (
4+
"context"
5+
6+
"github.com/openshift/installer/pkg/infrastructure/clusterapi"
7+
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
8+
)
9+
10+
var _ clusterapi.PreProvider = (*Provider)(nil)
11+
var _ clusterapi.Provider = (*Provider)(nil)
12+
13+
// Provider implements IBM Cloud CAPI installation.
14+
type Provider struct{}
15+
16+
// Name returns the IBM Cloud provider name.
17+
func (p Provider) Name() string {
18+
return ibmcloudtypes.Name
19+
}
20+
21+
// PreProvision creates the IBM Cloud objects required prior to running capibmcloud.
22+
func (p Provider) PreProvision(ctx context.Context, in clusterapi.PreProvisionInput) error {
23+
return nil
24+
}

pkg/infrastructure/platform/platform.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
azureinfra "github.com/openshift/installer/pkg/infrastructure/azure"
1414
"github.com/openshift/installer/pkg/infrastructure/clusterapi"
1515
gcpcapi "github.com/openshift/installer/pkg/infrastructure/gcp/clusterapi"
16+
ibmcloudcapi "github.com/openshift/installer/pkg/infrastructure/ibmcloud/clusterapi"
1617
openstackcapi "github.com/openshift/installer/pkg/infrastructure/openstack/clusterapi"
1718
powervscapi "github.com/openshift/installer/pkg/infrastructure/powervs/clusterapi"
1819
vspherecapi "github.com/openshift/installer/pkg/infrastructure/vsphere/clusterapi"
@@ -70,6 +71,9 @@ func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastr
7071
}
7172
return terraform.InitializeProvider(gcp.PlatformStages), nil
7273
case ibmcloudtypes.Name:
74+
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
75+
return clusterapi.InitializeProvider(ibmcloudcapi.Provider{}), nil
76+
}
7377
return terraform.InitializeProvider(ibmcloud.PlatformStages), nil
7478
case libvirttypes.Name:
7579
return terraform.InitializeProvider(libvirt.PlatformStages), nil

pkg/infrastructure/platform/platform_altinfra.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ import (
1313
azurecapi "github.com/openshift/installer/pkg/infrastructure/azure"
1414
"github.com/openshift/installer/pkg/infrastructure/clusterapi"
1515
gcpcapi "github.com/openshift/installer/pkg/infrastructure/gcp/clusterapi"
16+
ibmcloudcapi "github.com/openshift/installer/pkg/infrastructure/ibmcloud/clusterapi"
1617
openstackcapi "github.com/openshift/installer/pkg/infrastructure/openstack/clusterapi"
1718
powervscapi "github.com/openshift/installer/pkg/infrastructure/powervs/clusterapi"
1819
vspherecapi "github.com/openshift/installer/pkg/infrastructure/vsphere/clusterapi"
1920
awstypes "github.com/openshift/installer/pkg/types/aws"
2021
azuretypes "github.com/openshift/installer/pkg/types/azure"
2122
"github.com/openshift/installer/pkg/types/featuregates"
2223
gcptypes "github.com/openshift/installer/pkg/types/gcp"
24+
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
2325
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
2426
powervstypes "github.com/openshift/installer/pkg/types/powervs"
2527
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
@@ -43,6 +45,11 @@ func ProviderForPlatform(platform string, fg featuregates.FeatureGate) (infrastr
4345
return clusterapi.InitializeProvider(gcpcapi.Provider{}), nil
4446
}
4547
return nil, nil
48+
case ibmcloudtypes.Name:
49+
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
50+
return clusterapi.InitializeProvider(ibmcloudcapi.Provider{}), nil
51+
}
52+
return nil, nil
4653
case vspheretypes.Name:
4754
if fg.Enabled(configv1.FeatureGateClusterAPIInstall) {
4855
return clusterapi.InitializeProvider(vspherecapi.Provider{}), nil

0 commit comments

Comments
 (0)