From d45dff00899f1bbfb90ec4c24e9cc9ab1b80e9ab Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Thu, 4 May 2023 17:31:01 +0800 Subject: [PATCH] feat(climc): create k8s cluster v1.22.9 --- pkg/mcclient/options/k8s/cluster.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/mcclient/options/k8s/cluster.go b/pkg/mcclient/options/k8s/cluster.go index 2625406b1b..0b6cc1e77b 100644 --- a/pkg/mcclient/options/k8s/cluster.go +++ b/pkg/mcclient/options/k8s/cluster.go @@ -68,7 +68,7 @@ type K8SClusterCreateOptions struct { ServiceCidr string `help:"Cluster service CIDR, e.g. 10.43.0.0/16"` ServiceDomain string `help:"Cluster service domain, e.g. cluster.local"` Vip string `help:"Cluster api server static loadbalancer vip"` - Version string `help:"Cluster kubernetes version"` + Version string `help:"Cluster kubernetes version" choices:"v1.17.0|v1.19.0|v1.22.9"` ImageRepo string `help:"Image repository, e.g. registry-1.docker.io/yunion"` ImageRepoInsecure bool `help:"Image repostiory is insecure"` Vpc string `help:"Cluster nodes network vpc"` @@ -181,6 +181,9 @@ func (o K8SClusterCreateOptions) Params() (jsonutils.JSONObject, error) { if o.Vpc != "" { params.Add(jsonutils.NewString(o.Vpc), "vpc_id") } + if o.Version != "" { + params.Add(jsonutils.NewString(o.Version), "version") + } imageRepo := jsonutils.NewDict() if o.ImageRepo != "" { imageRepo.Add(jsonutils.NewString(o.ImageRepo), "url")