Skip to content

Commit

Permalink
chore: deprecated reconfigure api field for kb-1.0 (#541)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3717822)
  • Loading branch information
sophon-zt authored and ldming committed Jan 24, 2025
1 parent b2a8e0b commit 4d5471f
Showing 1 changed file with 28 additions and 53 deletions.
81 changes: 28 additions & 53 deletions pkg/action/template/cluster_operations_template.cue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ options: {
instanceTPLNames: [...string]
rebuildInstanceFrom: [
...{
componentName: string
backupName?: string
inPlace?: bool
componentName: string
backupName?: string
inPlace?: bool
sourceBackupTargetName?: string
instances: [
...{
Expand All @@ -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}
Expand Down Expand Up @@ -155,7 +155,7 @@ content: {
replicaChanges: strconv.Atoi(options.replicas)
}
if len(options.offlineInstancesToOnline) > 0 {
offlineInstancesToOnline: options.offlineInstancesToOnline
offlineInstancesToOnline: options.offlineInstancesToOnline
}
}
}
Expand All @@ -165,8 +165,8 @@ content: {
replicaChanges: strconv.Atoi(options.replicas)
}
if len(options.onlineInstancesToOffline) > 0 {
onlineInstancesToOffline: options.onlineInstancesToOffline
}
onlineInstancesToOffline: options.onlineInstancesToOffline
}
}
}
}]
Expand Down Expand Up @@ -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 {
Expand All @@ -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" {
Expand All @@ -300,7 +275,7 @@ content: {
{
componentName: options.component
if len(options.params) > 0 {
parameters: options.params
parameters: options.params
}
},
]
Expand Down

0 comments on commit 4d5471f

Please sign in to comment.