Skip to content

Commit

Permalink
🌱 add talos providers to defaults in clusterctl
Browse files Browse the repository at this point in the history
This PR will add the talos bootstrap and controlplane providers to the
list of default providers to enable with `clusterctl init`.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
  • Loading branch information
rsmitty committed Jun 30, 2020
1 parent ef2b61f commit 5ca2931
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
39 changes: 30 additions & 9 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@ import (
)

const (
ClusterAPIProviderName = "cluster-api"
KubeadmBootstrapProviderName = "kubeadm"
// Core providers
ClusterAPIProviderName = "cluster-api"

// Infra providers
AWSProviderName = "aws"
AzureProviderName = "azure"
Metal3ProviderName = "metal3"
OpenStackProviderName = "openstack"
PacketProviderName = "packet"
VSphereProviderName = "vsphere"

// Bootstrap providers
KubeadmBootstrapProviderName = "kubeadm"
TalosBootstrapProviderName = "talos"

// ControlPlane providers
KubeadmControlPlaneProviderName = "kubeadm"
AWSProviderName = "aws"
AzureProviderName = "azure"
Metal3ProviderName = "metal3"
OpenStackProviderName = "openstack"
VSphereProviderName = "vsphere"
PacketProviderName = "packet"
ProvidersConfigKey = "providers"
TalosControlPlaneProviderName = "talos"

// Other
ProvidersConfigKey = "providers"
)

// ProvidersClient has methods to work with provider configurations.
Expand Down Expand Up @@ -117,13 +128,23 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/kubernetes-sigs/cluster-api/releases/latest/bootstrap-components.yaml",
providerType: clusterctlv1.BootstrapProviderType,
},
&provider{
name: TalosBootstrapProviderName,
url: "https://github.com/talos-systems/cluster-api-bootstrap-provider-talos/releases/latest/bootstrap-components.yaml",
providerType: clusterctlv1.BootstrapProviderType,
},

// ControlPlane providers
&provider{
name: KubeadmControlPlaneProviderName,
url: "https://github.com/kubernetes-sigs/cluster-api/releases/latest/control-plane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},
&provider{
name: TalosControlPlaneProviderName,
url: "https://github.com/talos-systems/cluster-api-control-plane-provider-talos/releases/latest/control-plane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},
}

return defaults
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 @@ -54,7 +54,9 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
wantProviders: []string{
config.ClusterAPIProviderName,
config.KubeadmBootstrapProviderName,
config.TalosBootstrapProviderName,
config.KubeadmControlPlaneProviderName,
config.TalosControlPlaneProviderName,
config.AWSProviderName,
config.AzureProviderName,
config.Metal3ProviderName,
Expand All @@ -74,7 +76,9 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.ClusterAPIProviderName,
customProviderConfig.Name(),
config.KubeadmBootstrapProviderName,
config.TalosBootstrapProviderName,
config.KubeadmControlPlaneProviderName,
config.TalosControlPlaneProviderName,
config.AWSProviderName,
config.AzureProviderName,
config.Metal3ProviderName,
Expand Down

0 comments on commit 5ca2931

Please sign in to comment.