feat(climc): k8s cluster extra config (#15390)

This commit is contained in:
Zexi Li
2022-11-17 18:41:21 +08:00
committed by GitHub
parent a0dea0ccf2
commit a805af5564
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -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()
+10
View File
@@ -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
}