diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index 2d61bcefcbbe..98f53906e360 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -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. @@ -117,6 +128,11 @@ 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{ @@ -124,6 +140,11 @@ func (p *providersClient) defaults() []Provider { 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 diff --git a/cmd/clusterctl/client/config_test.go b/cmd/clusterctl/client/config_test.go index c5cbed5671bc..9471dc7d1127 100644 --- a/cmd/clusterctl/client/config_test.go +++ b/cmd/clusterctl/client/config_test.go @@ -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, @@ -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, diff --git a/cmd/clusterctl/cmd/config_repositories_test.go b/cmd/clusterctl/cmd/config_repositories_test.go index ae52243c6d44..542544d0e739 100644 --- a/cmd/clusterctl/cmd/config_repositories_test.go +++ b/cmd/clusterctl/cmd/config_repositories_test.go @@ -98,18 +98,20 @@ providers: type: "CoreProvider" ` -var expectedOutputText = `NAME TYPE URL FILE -cluster-api CoreProvider https://github.com/myorg/myforkofclusterapi/releases/latest/ core_components.yaml -another-provider BootstrapProvider ./ bootstrap-components.yaml -kubeadm BootstrapProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ bootstrap-components.yaml -kubeadm ControlPlaneProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ control-plane-components.yaml -aws InfrastructureProvider my-aws-infrastructure-components.yaml -azure InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-azure/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 -packet InfrastructureProvider https://github.com/kubernetes-sigs/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 +var expectedOutputText = `NAME TYPE URL FILE +cluster-api CoreProvider https://github.com/myorg/myforkofclusterapi/releases/latest/ core_components.yaml +another-provider BootstrapProvider ./ bootstrap-components.yaml +kubeadm BootstrapProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ bootstrap-components.yaml +talos BootstrapProvider https://github.com/talos-systems/cluster-api-bootstrap-provider-talos/releases/latest/ bootstrap-components.yaml +kubeadm ControlPlaneProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ control-plane-components.yaml +talos ControlPlaneProvider https://github.com/talos-systems/cluster-api-control-plane-provider-talos/releases/latest/ control-plane-components.yaml +aws InfrastructureProvider my-aws-infrastructure-components.yaml +azure InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-azure/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 +packet InfrastructureProvider https://github.com/kubernetes-sigs/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 ` var expectedOutputYaml = `- File: core_components.yaml @@ -124,10 +126,18 @@ var expectedOutputYaml = `- File: core_components.yaml Name: kubeadm ProviderType: BootstrapProvider URL: https://github.com/kubernetes-sigs/cluster-api/releases/latest/ +- File: bootstrap-components.yaml + Name: talos + ProviderType: BootstrapProvider + URL: https://github.com/talos-systems/cluster-api-bootstrap-provider-talos/releases/latest/ - File: control-plane-components.yaml Name: kubeadm ProviderType: ControlPlaneProvider URL: https://github.com/kubernetes-sigs/cluster-api/releases/latest/ +- File: control-plane-components.yaml + Name: talos + ProviderType: ControlPlaneProvider + URL: https://github.com/talos-systems/cluster-api-control-plane-provider-talos/releases/latest/ - File: my-aws-infrastructure-components.yaml Name: aws ProviderType: InfrastructureProvider