diff --git a/pkg/action/template/cluster_operations_template.cue b/pkg/action/template/cluster_operations_template.cue index 129187a41..abc685414 100644 --- a/pkg/action/template/cluster_operations_template.cue +++ b/pkg/action/template/cluster_operations_template.cue @@ -36,9 +36,9 @@ options: { instanceTPLNames: [...string] rebuildInstanceFrom: [ ...{ - componentName: string - backupName?: string - inPlace?: bool + componentName: string + backupName?: string + inPlace?: bool sourceBackupTargetName?: string instances: [ ...{ @@ -59,8 +59,8 @@ options: { replicas: string offlineInstancesToOnline: [...string] onlineInstancesToOffline: [...string] - scaleOut: bool - storage: string + scaleOut: bool + storage: string opsDefinitionName: string vctNames: [...string] keyValues: [string]: {string | null} @@ -155,7 +155,7 @@ content: { replicaChanges: strconv.Atoi(options.replicas) } if len(options.offlineInstancesToOnline) > 0 { - offlineInstancesToOnline: options.offlineInstancesToOnline + offlineInstancesToOnline: options.offlineInstancesToOnline } } } @@ -165,8 +165,8 @@ content: { replicaChanges: strconv.Atoi(options.replicas) } if len(options.onlineInstancesToOffline) > 0 { - onlineInstancesToOffline: options.onlineInstancesToOffline - } + onlineInstancesToOffline: options.onlineInstancesToOffline + } } } }] @@ -217,52 +217,27 @@ content: { }] } if options.type == "Reconfiguring" { - if len(options.componentNames) == 1 { - reconfigure: { - componentName: options.componentNames[0] - configurations: [ { - name: options.cfgTemplateName - if options.forceRestart { - policy: "simple" + reconfigures: [ for _, cName in options.componentNames { + componentName: cName + configurations: [ { + name: options.cfgTemplateName + if options.forceRestart { + policy: "simple" + } + keys: [{ + key: options.cfgFile + if options.fileContent != "" { + fileContent: options.fileContent } - keys: [{ - key: options.cfgFile - if options.fileContent != "" { - fileContent: options.fileContent - } - if options.hasPatch { - parameters: [ for k, v in options.keyValues { - key: k - value: v - }] - } - }] - }] - } - } - if len(options.componentNames) > 1 { - reconfigures: [ for _, cName in options.componentNames { - componentName: cName - configurations: [ { - name: options.cfgTemplateName - if options.forceRestart { - policy: "simple" + if options.hasPatch { + parameters: [ for k, v in options.keyValues { + key: k + value: v + }] } - keys: [{ - key: options.cfgFile - if options.fileContent != "" { - fileContent: options.fileContent - } - if options.hasPatch { - parameters: [ for k, v in options.keyValues { - key: k - value: v - }] - } - }] }] }] - } + }] } if options.type == "Expose" { expose: [ for _, cName in options.componentNames { @@ -286,8 +261,8 @@ content: { if options.type == "Switchover" { switchover: [{ componentObjectName: options.componentObjectName - instanceName: options.instance - candidateName: options.instance + instanceName: options.instance + candidateName: options.instance }] } if options.type == "RebuildInstance" { @@ -300,7 +275,7 @@ content: { { componentName: options.component if len(options.params) > 0 { - parameters: options.params + parameters: options.params } }, ]