Skip to content

Commit cbd185e

Browse files
committed
fix redis announce
Signed-off-by: samiul <samiul@appscode.com>
1 parent 0f13689 commit cbd185e

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

charts/kubedbcom-redis-editor-options/ui/create-ui.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ step:
142142
value: setAnnounce
143143
label: Announce Redis Endpoints ?
144144
watcher:
145-
func: setAnnounce
145+
func: commitAnnounceChanges
146146
paths:
147147
- temp/announce
148148
schema: temp/announce
@@ -159,12 +159,18 @@ step:
159159
value: hostname
160160
schema: schema/properties/spec/properties/cluster/properties/announce/properties/type
161161
type: select
162-
- type: array-item-form
163-
element:
164-
label: Shard Endpoints (comma-separated, e.g. "endpoint1,endpoint2,endpoint3")
165-
type: input
162+
- type: array-object-form
166163
label: Shards
164+
buttonClass: is-light is-outlined
167165
schema: schema/properties/spec/properties/cluster/properties/announce/properties/shards
166+
elements:
167+
- label: Shard Endpoints
168+
schema: endpoints
169+
buttonClass: is-light is-outlined
170+
type: array-item-form
171+
element:
172+
label: Endpoint
173+
type: input
168174
if:
169175
type: function
170176
name: showAnnounce

charts/kubedbcom-redis-editor-options/ui/functions.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,15 @@ export const useFunc = (model) => {
10971097
value: null,
10981098
force: true,
10991099
})
1100+
return false
1101+
}
1102+
1103+
function commitAnnounceChanges() {
1104+
commit('wizard/model$update', {
1105+
path: '/spec/cluster/announce',
1106+
value: null,
1107+
force: true,
1108+
})
11001109
}
11011110

11021111
function setBackup() {
@@ -1383,7 +1392,10 @@ export const useFunc = (model) => {
13831392
const endpointsObject = Object.values(endpoints)
13841393
const length = Object.keys(endpointsObject?.[0])?.length
13851394
if (length !== replicas)
1386-
return { isInvalid: true, message: `Endpoints length should be equal to replicas(${replicas})` }
1395+
return {
1396+
isInvalid: true,
1397+
message: `Endpoints length should be equal to replicas(${replicas})`,
1398+
}
13871399
else {
13881400
return {}
13891401
}
@@ -1463,5 +1475,6 @@ export const useFunc = (model) => {
14631475
updateAlertValue,
14641476
validateEndpoints,
14651477
zonesOnChange,
1478+
commitAnnounceChanges,
14661479
}
14671480
}

0 commit comments

Comments
 (0)