|
| 1 | +package clusterapi |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + |
| 6 | + "github.com/openshift/installer/pkg/infrastructure/clusterapi" |
| 7 | + gcptypes "github.com/openshift/installer/pkg/types/gcp" |
| 8 | +) |
| 9 | + |
| 10 | +// Provider implements gcp infrastructure in conjunction with the |
| 11 | +// GCP CAPI provider. |
| 12 | +type Provider struct { |
| 13 | +} |
| 14 | + |
| 15 | +var _ clusterapi.PreProvider = (*Provider)(nil) |
| 16 | +var _ clusterapi.IgnitionProvider = (*Provider)(nil) |
| 17 | +var _ clusterapi.InfraReadyProvider = (*Provider)(nil) |
| 18 | +var _ clusterapi.PostProvider = (*Provider)(nil) |
| 19 | + |
| 20 | +// Name returns the name for the platform. |
| 21 | +func (p Provider) Name() string { |
| 22 | + return gcptypes.Name |
| 23 | +} |
| 24 | + |
| 25 | +// PreProvision is called before provisioning using CAPI controllers has initiated. |
| 26 | +// GCP resources that are not created by CAPG (and are required for other stages of the install) are |
| 27 | +// created here using the gcp sdk. |
| 28 | +func (p Provider) PreProvision(ctx context.Context, in clusterapi.PreProvisionInput) error { |
| 29 | + return nil |
| 30 | +} |
| 31 | + |
| 32 | +// Ignition provisions the GCP bucket and url that points to the bucket. Bootstrap ignition data cannot |
| 33 | +// populate the metadata field of the bootstrap instance as the data can be too large. Instead, the data is |
| 34 | +// added to a bucket. A signed url is generated to point to the bucket and the ignition data will be |
| 35 | +// updated to point to the url. This is also allows for bootstrap data to be edited after its initial creation. |
| 36 | +func (p Provider) Ignition(ctx context.Context, in clusterapi.IgnitionInput) ([]byte, error) { |
| 37 | + return nil, nil |
| 38 | +} |
| 39 | + |
| 40 | +// InfraReady is called once cluster.Status.InfrastructureReady |
| 41 | +// is true, typically after load balancers have been provisioned. It can be used |
| 42 | +// to create DNS records. |
| 43 | +func (p Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput) error { |
| 44 | + return nil |
| 45 | +} |
| 46 | + |
| 47 | +// PostProvision should be called to add or update and GCP resources after provisioning has completed. |
| 48 | +func (p Provider) PostProvision(ctx context.Context, in clusterapi.PostProvisionInput) error { |
| 49 | + return nil |
| 50 | +} |
0 commit comments