diff --git a/cmd/climc/shell/k8s/clusters.go b/cmd/climc/shell/k8s/clusters.go index 259d6f97e7..b7abbc4d79 100644 --- a/cmd/climc/shell/k8s/clusters.go +++ b/cmd/climc/shell/k8s/clusters.go @@ -52,6 +52,8 @@ func initKubeCluster() { cmd.Perform("delete-machines", new(o.KubeClusterDeleteMachinesOptions)) cmd.Perform("add-machines", new(o.KubeClusterAddMachinesOptions)) cmd.PerformClass("gc", new(o.ClusterGCOpts)) + cmd.Perform("set-extra-config", new(o.ClusterSetExtraConfigOpt)) + cmd.Get("extra-config", new(o.IdentOptions)) R(&o.KubeClusterImportOptions{}, cmdN("import"), "Import k8s cluster", func(s *mcclient.ClientSession, args *o.KubeClusterImportOptions) error { params, err := args.Params() diff --git a/pkg/mcclient/options/k8s/cluster.go b/pkg/mcclient/options/k8s/cluster.go index 613ffcb7b9..5f1d9c8f45 100644 --- a/pkg/mcclient/options/k8s/cluster.go +++ b/pkg/mcclient/options/k8s/cluster.go @@ -791,3 +791,13 @@ func (o ClusterGetAddonsOpt) Params() (jsonutils.JSONObject, error) { return params, nil } + +type ClusterSetExtraConfigOpt struct { + IdentOptions + DockerRegistryMirrors []string `json:"docker_registry_mirrors"` + DockerInsecureRegistries []string `json:"docker_insecure_registries"` +} + +func (o ClusterSetExtraConfigOpt) Params() (jsonutils.JSONObject, error) { + return jsonutils.Marshal(o), nil +}