Skip to content

Commit

Permalink
Merge pull request #3121 from deitch/packet-provider
Browse files Browse the repository at this point in the history
Add packet to list of default providers ✨
  • Loading branch information
k8s-ci-robot authored Jun 1, 2020
2 parents 78850ea + 0e6c10b commit cadd99c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
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 (
Metal3ProviderName = "metal3"
OpenStackProviderName = "openstack"
VSphereProviderName = "vsphere"
PacketProviderName = "packet"
ProvidersConfigKey = "providers"
)

Expand Down Expand Up @@ -89,6 +90,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: PacketProviderName,
url: "https://github.com/packethost/cluster-api-provider-packet/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: Metal3ProviderName,
url: "https://github.com/metal3-io/cluster-api-provider-metal3/releases/latest/infrastructure-components.yaml",
Expand Down
4 changes: 4 additions & 0 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
field: field{
client: newFakeClient(newFakeConfig()),
},
// note: these will be sorted by name by the Providers() call, so be sure they are in alphabetical order here too
wantProviders: []string{
config.ClusterAPIProviderName,
config.KubeadmBootstrapProviderName,
Expand All @@ -58,6 +59,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.AzureProviderName,
config.Metal3ProviderName,
config.OpenStackProviderName,
config.PacketProviderName,
config.VSphereProviderName,
},
wantErr: false,
Expand All @@ -67,6 +69,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
field: field{
client: newFakeClient(newFakeConfig().WithProvider(customProviderConfig)),
},
// note: these will be sorted by name by the Providers() call, so be sure they are in alphabetical order here too
wantProviders: []string{
config.ClusterAPIProviderName,
customProviderConfig.Name(),
Expand All @@ -76,6 +79,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.AzureProviderName,
config.Metal3ProviderName,
config.OpenStackProviderName,
config.PacketProviderName,
config.VSphereProviderName,
},
wantErr: false,
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 @@ -206,6 +206,18 @@ func (f *metadataClient) getEmbeddedMetadata() *clusterctlv1.Metadata {
// older version are not supported by clusterctl
},
}
case config.PacketProviderName:
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.OpenStackProviderName:
return &clusterctlv1.Metadata{
TypeMeta: metav1.TypeMeta{
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 @@ -108,6 +108,7 @@ azure InfrastructureProvider https://github.com/kubernetes-sigs/
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
packet InfrastructureProvider https://github.com/packethost/cluster-api-provider-packet/releases/latest/ infrastructure-components.yaml
vsphere InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/ infrastructure-components.yaml
`

Expand Down Expand Up @@ -147,6 +148,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: openstack
ProviderType: InfrastructureProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/latest/
- File: infrastructure-components.yaml
Name: packet
ProviderType: InfrastructureProvider
URL: https://github.com/packethost/cluster-api-provider-packet/releases/latest/
- File: infrastructure-components.yaml
Name: vsphere
ProviderType: InfrastructureProvider
Expand Down

0 comments on commit cadd99c

Please sign in to comment.