From af23921bf82b6f279aa6a23fb5eb51cf1c7b927a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Fri, 19 Feb 2021 17:23:57 +0100 Subject: [PATCH] feat(k8s): add default cni (cilium) for cluster create --- .../testdata/test-all-usage-k8s-cluster-create-usage.golden | 2 +- internal/namespaces/k8s/v1/custom_cluster.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden index 86061b7cab..ab84a6b340 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden @@ -18,7 +18,7 @@ ARGS: [description] The description of the cluster [tags.{index}] The tags associated with the cluster version The Kubernetes version of the cluster - cni The Container Network Interface (CNI) plugin that will run in the cluster (unknown_cni | cilium | calico | weave | flannel) + cni=cilium The Container Network Interface (CNI) plugin that will run in the cluster (unknown_cni | cilium | calico | weave | flannel) [enable-dashboard] The enablement of the Kubernetes Dashboard in the cluster [ingress] The Ingress Controller that will run in the cluster (unknown_ingress | none | nginx | traefik | traefik2) pools.{index}.name The name of the pool diff --git a/internal/namespaces/k8s/v1/custom_cluster.go b/internal/namespaces/k8s/v1/custom_cluster.go index 20b088f3f6..b34b09e567 100644 --- a/internal/namespaces/k8s/v1/custom_cluster.go +++ b/internal/namespaces/k8s/v1/custom_cluster.go @@ -85,6 +85,9 @@ func clusterAvailableVersionsListBuilder(c *core.Command) *core.Command { func clusterCreateBuilder(c *core.Command) *core.Command { c.WaitFunc = waitForClusterFunc(clusterActionCreate) + + c.ArgSpecs.GetByName("cni").Default = core.DefaultValueSetter("cilium") + return c }