Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions charts/kubedbcom-redis-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ step:
value: setAnnounce
label: Announce Redis Endpoints ?
watcher:
func: setAnnounce
func: commitAnnounceChanges
paths:
- temp/announce
schema: temp/announce
Expand All @@ -160,12 +160,18 @@ step:
value: hostname
schema: schema/properties/spec/properties/cluster/properties/announce/properties/type
type: select
- type: array-item-form
element:
label: Shard Endpoints (comma-separated, e.g. "endpoint1,endpoint2,endpoint3")
type: input
- type: array-object-form
label: Shards
buttonClass: is-light is-outlined
schema: schema/properties/spec/properties/cluster/properties/announce/properties/shards
elements:
- label: Shard Endpoints
schema: endpoints
buttonClass: is-light is-outlined
type: array-item-form
element:
label: Endpoint
type: input
if:
type: function
name: showAnnounce
Expand Down
15 changes: 14 additions & 1 deletion charts/kubedbcom-redis-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,15 @@ export const useFunc = (model) => {
value: null,
force: true,
})
return false
}

function commitAnnounceChanges() {
commit('wizard/model$update', {
path: '/spec/cluster/announce',
value: null,
force: true,
})
}

function setBackup() {
Expand Down Expand Up @@ -1383,7 +1392,10 @@ export const useFunc = (model) => {
const endpointsObject = Object.values(endpoints)
const length = Object.keys(endpointsObject?.[0])?.length
if (length !== replicas)
return { isInvalid: true, message: `Endpoints length should be equal to replicas(${replicas})` }
return {
isInvalid: true,
message: `Endpoints length should be equal to replicas(${replicas})`,
}
else {
return {}
}
Expand Down Expand Up @@ -1463,5 +1475,6 @@ export const useFunc = (model) => {
updateAlertValue,
validateEndpoints,
zonesOnChange,
commitAnnounceChanges,
}
}
Loading