Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-Pick gcp: add capg to clusterctl providers list #4008

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
AzureProviderName = "azure"
DockerProviderName = "docker"
DOProviderName = "digitalocean"
GCPProviderName = "gcp"
Metal3ProviderName = "metal3"
OpenStackProviderName = "openstack"
PacketProviderName = "packet"
Expand Down Expand Up @@ -117,6 +118,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: GCPProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: PacketProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api-provider-packet/releases/latest/infrastructure-components.yaml",
Expand Down
2 changes: 2 additions & 0 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.AzureProviderName,
config.DOProviderName,
config.DockerProviderName,
config.GCPProviderName,
config.Metal3ProviderName,
config.OpenStackProviderName,
config.PacketProviderName,
Expand Down Expand Up @@ -92,6 +93,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.AzureProviderName,
config.DOProviderName,
config.DockerProviderName,
config.GCPProviderName,
config.Metal3ProviderName,
config.OpenStackProviderName,
config.PacketProviderName,
Expand Down
12 changes: 12 additions & 0 deletions cmd/clusterctl/client/repository/metadata_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,18 @@ func (f *metadataClient) getEmbeddedMetadata() *clusterctlv1.Metadata {
// older version are not supported by clusterctl
},
}
case config.GCPProviderName:
return &clusterctlv1.Metadata{
TypeMeta: metav1.TypeMeta{
APIVersion: clusterctlv1.GroupVersion.String(),
Kind: "Metadata",
},
ReleaseSeries: []clusterctlv1.ReleaseSeries{
// v1alpha3 release series
{Major: 0, Minor: 3, Contract: "v1alpha3"},
// older version are not supported by clusterctl
},
}
case config.Metal3ProviderName:
return &clusterctlv1.Metadata{
TypeMeta: metav1.TypeMeta{
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/cmd/config_repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var configRepositoryCmd = &cobra.Command{
Example: Examples(`
# Displays the list of available providers.
clusterctl config repositories

# Print the list of available providers in yaml format.
clusterctl config repositories -o yaml`),

Expand Down
5 changes: 5 additions & 0 deletions cmd/clusterctl/cmd/config_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ aws InfrastructureProvider
azure InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/latest/ infrastructure-components.yaml
digitalocean InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean/releases/latest/ infrastructure-components.yaml
docker InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-development.yaml
gcp InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/ infrastructure-components.yaml
metal3 InfrastructureProvider https://github.com/metal3-io/cluster-api-provider-metal3/releases/latest/ infrastructure-components.yaml
my-infra-provider InfrastructureProvider /home/.cluster-api/overrides/infrastructure-docker/latest/ infrastructure-components.yaml
openstack InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/latest/ infrastructure-components.yaml
Expand Down Expand Up @@ -168,6 +169,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: docker
ProviderType: InfrastructureProvider
URL: https://github.com/kubernetes-sigs/cluster-api/releases/latest/
- File: infrastructure-components.yaml
Name: gcp
ProviderType: InfrastructureProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/
- File: infrastructure-components.yaml
Name: metal3
ProviderType: InfrastructureProvider
Expand Down