Skip to content

Commit c0b4ce7

Browse files
committed
fix redis announce
Signed-off-by: samiul <samiul@appscode.com>
1 parent 18ccb23 commit c0b4ce7

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
@@ -143,7 +143,7 @@ step:
143143
value: setAnnounce
144144
label: Announce Redis Endpoints ?
145145
watcher:
146-
func: setAnnounce
146+
func: commitAnnounceChanges
147147
paths:
148148
- temp/announce
149149
schema: temp/announce
@@ -160,12 +160,18 @@ step:
160160
value: hostname
161161
schema: schema/properties/spec/properties/cluster/properties/announce/properties/type
162162
type: select
163-
- type: array-item-form
164-
element:
165-
label: Shard Endpoints (comma-separated, e.g. "endpoint1,endpoint2,endpoint3")
166-
type: input
163+
- type: array-object-form
167164
label: Shards
165+
buttonClass: is-light is-outlined
168166
schema: schema/properties/spec/properties/cluster/properties/announce/properties/shards
167+
elements:
168+
- label: Shard Endpoints
169+
schema: endpoints
170+
buttonClass: is-light is-outlined
171+
type: array-item-form
172+
element:
173+
label: Endpoint
174+
type: input
169175
if:
170176
type: function
171177
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)