Skip to content

Commit 3717822

Browse files
authored
chore: deprecated reconfigure api field for kb-1.0 (#541)
1 parent b64be7d commit 3717822

File tree

1 file changed

+28
-53
lines changed

1 file changed

+28
-53
lines changed

pkg/action/template/cluster_operations_template.cue

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ options: {
3636
instanceTPLNames: [...string]
3737
rebuildInstanceFrom: [
3838
...{
39-
componentName: string
40-
backupName?: string
41-
inPlace?: bool
39+
componentName: string
40+
backupName?: string
41+
inPlace?: bool
4242
sourceBackupTargetName?: string
4343
instances: [
4444
...{
@@ -59,8 +59,8 @@ options: {
5959
replicas: string
6060
offlineInstancesToOnline: [...string]
6161
onlineInstancesToOffline: [...string]
62-
scaleOut: bool
63-
storage: string
62+
scaleOut: bool
63+
storage: string
6464
opsDefinitionName: string
6565
vctNames: [...string]
6666
keyValues: [string]: {string | null}
@@ -155,7 +155,7 @@ content: {
155155
replicaChanges: strconv.Atoi(options.replicas)
156156
}
157157
if len(options.offlineInstancesToOnline) > 0 {
158-
offlineInstancesToOnline: options.offlineInstancesToOnline
158+
offlineInstancesToOnline: options.offlineInstancesToOnline
159159
}
160160
}
161161
}
@@ -165,8 +165,8 @@ content: {
165165
replicaChanges: strconv.Atoi(options.replicas)
166166
}
167167
if len(options.onlineInstancesToOffline) > 0 {
168-
onlineInstancesToOffline: options.onlineInstancesToOffline
169-
}
168+
onlineInstancesToOffline: options.onlineInstancesToOffline
169+
}
170170
}
171171
}
172172
}]
@@ -217,52 +217,27 @@ content: {
217217
}]
218218
}
219219
if options.type == "Reconfiguring" {
220-
if len(options.componentNames) == 1 {
221-
reconfigure: {
222-
componentName: options.componentNames[0]
223-
configurations: [ {
224-
name: options.cfgTemplateName
225-
if options.forceRestart {
226-
policy: "simple"
220+
reconfigures: [ for _, cName in options.componentNames {
221+
componentName: cName
222+
configurations: [ {
223+
name: options.cfgTemplateName
224+
if options.forceRestart {
225+
policy: "simple"
226+
}
227+
keys: [{
228+
key: options.cfgFile
229+
if options.fileContent != "" {
230+
fileContent: options.fileContent
227231
}
228-
keys: [{
229-
key: options.cfgFile
230-
if options.fileContent != "" {
231-
fileContent: options.fileContent
232-
}
233-
if options.hasPatch {
234-
parameters: [ for k, v in options.keyValues {
235-
key: k
236-
value: v
237-
}]
238-
}
239-
}]
240-
}]
241-
}
242-
}
243-
if len(options.componentNames) > 1 {
244-
reconfigures: [ for _, cName in options.componentNames {
245-
componentName: cName
246-
configurations: [ {
247-
name: options.cfgTemplateName
248-
if options.forceRestart {
249-
policy: "simple"
232+
if options.hasPatch {
233+
parameters: [ for k, v in options.keyValues {
234+
key: k
235+
value: v
236+
}]
250237
}
251-
keys: [{
252-
key: options.cfgFile
253-
if options.fileContent != "" {
254-
fileContent: options.fileContent
255-
}
256-
if options.hasPatch {
257-
parameters: [ for k, v in options.keyValues {
258-
key: k
259-
value: v
260-
}]
261-
}
262-
}]
263238
}]
264239
}]
265-
}
240+
}]
266241
}
267242
if options.type == "Expose" {
268243
expose: [ for _, cName in options.componentNames {
@@ -286,8 +261,8 @@ content: {
286261
if options.type == "Switchover" {
287262
switchover: [{
288263
componentObjectName: options.componentObjectName
289-
instanceName: options.instance
290-
candidateName: options.instance
264+
instanceName: options.instance
265+
candidateName: options.instance
291266
}]
292267
}
293268
if options.type == "RebuildInstance" {
@@ -300,7 +275,7 @@ content: {
300275
{
301276
componentName: options.component
302277
if len(options.params) > 0 {
303-
parameters: options.params
278+
parameters: options.params
304279
}
305280
},
306281
]

0 commit comments

Comments
 (0)