diff --git a/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml b/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml index 4fef7d3c38..b0e394b1a7 100644 --- a/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-cassandra-editor-options/ui/create-ui.yaml @@ -133,27 +133,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-cassandra-editor-options/ui/functions.js b/charts/kubedbcom-cassandra-editor-options/ui/functions.js index 762e05133b..dedd0acede 100644 --- a/charts/kubedbcom-cassandra-editor-options/ui/functions.js +++ b/charts/kubedbcom-cassandra-editor-options/ui/functions.js @@ -713,12 +713,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Cassandra/mode/toggle`)) { let defMode = getDefault('databases/Cassandra/mode') || '' if (defMode === '') { @@ -1020,6 +1014,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1111,6 +1128,7 @@ export const useFunc = (model) => { onAuthChange, setBackup, getDefault, + initDeletionPolicy, validateRackName, setServiceTemplate, } diff --git a/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml b/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml index 9ff77ddcee..4bf90a888d 100644 --- a/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-clickhouse-editor-options/ui/create-ui.yaml @@ -232,27 +232,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-clickhouse-editor-options/ui/functions.js b/charts/kubedbcom-clickhouse-editor-options/ui/functions.js index fff0207b82..787d284955 100644 --- a/charts/kubedbcom-clickhouse-editor-options/ui/functions.js +++ b/charts/kubedbcom-clickhouse-editor-options/ui/functions.js @@ -602,12 +602,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/ClickHouse/mode/toggle`)) { let defMode = getDefault('databases/ClickHouse/mode') || '' if (defMode === '') { @@ -961,6 +955,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1187,6 +1204,7 @@ export const useFunc = (model) => { setStorageClass, setBackup, getDefault, + initDeletionPolicy, setPointInTimeRecovery, onTimestampChange, showRecovery, diff --git a/charts/kubedbcom-db2-editor-options/ui/create-ui.yaml b/charts/kubedbcom-db2-editor-options/ui/create-ui.yaml index 1a6f1c68f7..3cc37e37ad 100644 --- a/charts/kubedbcom-db2-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-db2-editor-options/ui/create-ui.yaml @@ -116,27 +116,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: Keep only database Secrets and backed up data. - text: Delete - value: Delete - - description: Keep PVCs, database Secrets and backed up data. - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: Delete everything including backed up data. - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: Prevent deletion of the DB2 CRD. - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-db2-editor-options/ui/functions.js b/charts/kubedbcom-db2-editor-options/ui/functions.js index ddcd030599..f7a2c80497 100644 --- a/charts/kubedbcom-db2-editor-options/ui/functions.js +++ b/charts/kubedbcom-db2-editor-options/ui/functions.js @@ -491,12 +491,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/DB2/mode/toggle`)) { let defMode = getDefault('databases/DB2/mode') || '' if (defMode === '') { @@ -895,6 +889,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -993,5 +1010,6 @@ export const useFunc = (model) => { setStorageClass, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-documentdb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-documentdb-editor-options/ui/create-ui.yaml index 3eea5785d0..fdb169435e 100644 --- a/charts/kubedbcom-documentdb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-documentdb-editor-options/ui/create-ui.yaml @@ -114,27 +114,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-documentdb-editor-options/ui/functions.js b/charts/kubedbcom-documentdb-editor-options/ui/functions.js index 23e7da6203..17b5225ce8 100644 --- a/charts/kubedbcom-documentdb-editor-options/ui/functions.js +++ b/charts/kubedbcom-documentdb-editor-options/ui/functions.js @@ -723,12 +723,6 @@ export const useFunc = (model) => { }) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/DocumentDB/mode/toggle`)) { let defMode = getDefault('databases/DocumentDB/mode') || '' if (defMode === '') { @@ -1085,6 +1079,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1261,6 +1278,7 @@ export const useFunc = (model) => { filterNodeTopology, setBackup, getDefault, + initDeletionPolicy, onArchiverChange, showArchiverAlert, showArchiver, diff --git a/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml b/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml index 09bb49bc7d..cbd1a4e036 100644 --- a/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-druid-editor-options/ui/create-ui.yaml @@ -342,27 +342,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-druid-editor-options/ui/functions.js b/charts/kubedbcom-druid-editor-options/ui/functions.js index 8fd91ba26f..ebd35ef73b 100644 --- a/charts/kubedbcom-druid-editor-options/ui/functions.js +++ b/charts/kubedbcom-druid-editor-options/ui/functions.js @@ -755,12 +755,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Druid/mode/toggle`)) { let defMode = getDefault('databases/Druid/mode') || '' if (defMode === '') { @@ -1013,6 +1007,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1116,5 +1133,6 @@ export const useFunc = (model) => { setBackup, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml b/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml index fed266caf5..1c9ad85105 100644 --- a/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-elasticsearch-editor-options/ui/create-ui.yaml @@ -308,27 +308,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js b/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js index 963d0f980a..7c837fed10 100644 --- a/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js +++ b/charts/kubedbcom-elasticsearch-editor-options/ui/functions.js @@ -456,12 +456,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Elasticsearch/mode/toggle`)) { let defMode = getDefault('databases/Elasticsearch/mode') || '' if (defMode === '') { @@ -954,6 +948,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1059,5 +1076,6 @@ export const useFunc = (model) => { setBackup, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-hanadb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-hanadb-editor-options/ui/create-ui.yaml index 2039568fa4..8fd89538e0 100644 --- a/charts/kubedbcom-hanadb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-hanadb-editor-options/ui/create-ui.yaml @@ -152,27 +152,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-hanadb-editor-options/ui/functions.js b/charts/kubedbcom-hanadb-editor-options/ui/functions.js index 1fa37fec0b..429efdde91 100644 --- a/charts/kubedbcom-hanadb-editor-options/ui/functions.js +++ b/charts/kubedbcom-hanadb-editor-options/ui/functions.js @@ -683,12 +683,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/HanaDB/mode/toggle`)) { let defMode = getDefault('databases/HanaDB/mode') || '' if (defMode === '') { @@ -979,6 +973,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1073,5 +1090,6 @@ export const useFunc = (model) => { clearConfiguration, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml b/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml index f9035ded28..a7bc83b8d2 100644 --- a/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-hazelcast-editor-options/ui/create-ui.yaml @@ -114,27 +114,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-hazelcast-editor-options/ui/functions.js b/charts/kubedbcom-hazelcast-editor-options/ui/functions.js index 86fdb48d5d..b90aae8bc5 100644 --- a/charts/kubedbcom-hazelcast-editor-options/ui/functions.js +++ b/charts/kubedbcom-hazelcast-editor-options/ui/functions.js @@ -547,12 +547,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Hazelcast/mode/toggle`)) { let defMode = getDefault('databases/Hazelcast/mode') || '' if (defMode === '') { @@ -1010,6 +1004,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1212,5 +1229,6 @@ export const useFunc = (model) => { showAdditionalSettings, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml b/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml index f661d0543b..e318dedcd5 100644 --- a/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-ignite-editor-options/ui/create-ui.yaml @@ -109,27 +109,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-ignite-editor-options/ui/functions.js b/charts/kubedbcom-ignite-editor-options/ui/functions.js index 3a9799ee2f..29de7e087a 100644 --- a/charts/kubedbcom-ignite-editor-options/ui/functions.js +++ b/charts/kubedbcom-ignite-editor-options/ui/functions.js @@ -493,12 +493,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Ignite/mode/toggle`)) { let defMode = getDefault('databases/Ignite/mode') || '' if (defMode === '') { @@ -981,6 +975,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1085,5 +1102,6 @@ export const useFunc = (model) => { showAdditionalSettings, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml b/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml index 7279411101..4fb73fe74e 100644 --- a/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-kafka-editor-options/ui/create-ui.yaml @@ -244,21 +244,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.wipeOut.description - text: WipeOut - value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate + - text: DoNotTerminate — Blocks deletion; protects against accidental removal value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups + value: Halt + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups + value: WipeOut schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-kafka-editor-options/ui/functions.js b/charts/kubedbcom-kafka-editor-options/ui/functions.js index afdbb40b65..0e5c4f3041 100644 --- a/charts/kubedbcom-kafka-editor-options/ui/functions.js +++ b/charts/kubedbcom-kafka-editor-options/ui/functions.js @@ -558,12 +558,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Kafka/mode/toggle`)) { let defMode = getDefault('databases/Kafka/mode') || '' if (defMode === '') { @@ -901,6 +895,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -998,5 +1015,6 @@ export const useFunc = (model) => { showAlerts, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml index 6fc7e86722..50be78b53d 100644 --- a/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml @@ -196,27 +196,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-mariadb-editor-options/ui/functions.js b/charts/kubedbcom-mariadb-editor-options/ui/functions.js index c20b886391..40df0d42b8 100644 --- a/charts/kubedbcom-mariadb-editor-options/ui/functions.js +++ b/charts/kubedbcom-mariadb-editor-options/ui/functions.js @@ -715,12 +715,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/MariaDB/mode/toggle`)) { let defMode = getDefault('databases/MariaDB/mode') || '' if (defMode === '') { @@ -1115,6 +1109,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1350,6 +1367,7 @@ export const useFunc = (model) => { clearConfiguration, setBackup, getDefault, + initDeletionPolicy, onArchiverChange, showArchiverAlert, showArchiver, diff --git a/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml b/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml index 50511b5074..11ea1ba1b0 100644 --- a/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-memcached-editor-options/ui/create-ui.yaml @@ -96,27 +96,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select - if: diff --git a/charts/kubedbcom-memcached-editor-options/ui/functions.js b/charts/kubedbcom-memcached-editor-options/ui/functions.js index 967c6b4d79..7f0705c4bf 100644 --- a/charts/kubedbcom-memcached-editor-options/ui/functions.js +++ b/charts/kubedbcom-memcached-editor-options/ui/functions.js @@ -583,12 +583,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Memcached/mode/toggle`)) { let defMode = getDefault('databases/Memcached/mode') || '' if (defMode === '') { @@ -848,6 +842,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -942,5 +959,6 @@ export const useFunc = (model) => { isToggleOn, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml b/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml index cf9547e0a8..1b63c5d3de 100644 --- a/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-milvus-editor-options/ui/create-ui.yaml @@ -429,27 +429,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-milvus-editor-options/ui/functions.js b/charts/kubedbcom-milvus-editor-options/ui/functions.js index f8493e8eb9..71fca92716 100644 --- a/charts/kubedbcom-milvus-editor-options/ui/functions.js +++ b/charts/kubedbcom-milvus-editor-options/ui/functions.js @@ -683,12 +683,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Milvus/mode/toggle`)) { let defMode = getDefault('databases/Milvus/mode') || '' if (defMode === '') { @@ -1020,6 +1014,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1165,6 +1182,7 @@ export const useFunc = (model) => { isConfigDatabaseOn, clearConfiguration, getDefault, + initDeletionPolicy, isMetaStorageExternallyManaged, showEtcdOperatorWarning, getSecrets, diff --git a/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml index 83fcd8f2e7..aa899ec7ad 100644 --- a/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml @@ -347,27 +347,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-mongodb-editor-options/ui/functions.js b/charts/kubedbcom-mongodb-editor-options/ui/functions.js index a4a4be7e22..0bfd7b708a 100644 --- a/charts/kubedbcom-mongodb-editor-options/ui/functions.js +++ b/charts/kubedbcom-mongodb-editor-options/ui/functions.js @@ -796,12 +796,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/MongoDB/mode/toggle`)) { let defMode = getDefault('databases/MongoDB/mode') || '' if (defMode === '') { @@ -1223,6 +1217,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1496,6 +1513,7 @@ export const useFunc = (model) => { onAuthChange, setBackup, getDefault, + initDeletionPolicy, onArchiverChange, showArchiverAlert, showArchiver, diff --git a/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml index 5f22679744..c3b752d47c 100644 --- a/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mssqlserver-editor-options/ui/create-ui.yaml @@ -180,27 +180,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js b/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js index f8c71c6cf8..738ab7fe6d 100644 --- a/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js +++ b/charts/kubedbcom-mssqlserver-editor-options/ui/functions.js @@ -760,12 +760,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/MSSQLServer/mode/toggle`)) { let defMode = getDefault('databases/MSSQLServer/mode') || '' if (defMode === '') { @@ -1106,6 +1100,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaulPid() { return (pid = getValue(model, '/spec/pid') || '') } @@ -1379,6 +1396,7 @@ export const useFunc = (model) => { updateAlertValue, setBackup, getDefault, + initDeletionPolicy, getDefaulPid, onPidChange, isPidCustom, diff --git a/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml b/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml index 72264c9451..3d8e016a7d 100644 --- a/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-mysql-editor-options/ui/create-ui.yaml @@ -180,27 +180,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-mysql-editor-options/ui/functions.js b/charts/kubedbcom-mysql-editor-options/ui/functions.js index 902efb72b0..2c56594e86 100644 --- a/charts/kubedbcom-mysql-editor-options/ui/functions.js +++ b/charts/kubedbcom-mysql-editor-options/ui/functions.js @@ -698,12 +698,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/MySQL/mode/toggle`)) { let defMode = getDefault('databases/MySQL/mode') || '' if (defMode === '') { @@ -1103,6 +1097,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function convertToUTC(localTime) { const date = new Date(localTime) if (isNaN(date.getTime())) return @@ -1387,6 +1404,7 @@ export const useFunc = (model) => { clearConfiguration, setBackup, getDefault, + initDeletionPolicy, onArchiverChange, showArchiverAlert, showArchiver, diff --git a/charts/kubedbcom-neo4j-editor-options/ui/create-ui.yaml b/charts/kubedbcom-neo4j-editor-options/ui/create-ui.yaml index d9a96497ba..58f5a7219b 100644 --- a/charts/kubedbcom-neo4j-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-neo4j-editor-options/ui/create-ui.yaml @@ -116,27 +116,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: Keep only database Secrets and backed up data. - text: Delete - value: Delete - - description: Keep PVCs, database Secrets and backed up data. - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: Delete everything including backed up data. - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: Prevent deletion of the Neo4j CRD. - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-neo4j-editor-options/ui/functions.js b/charts/kubedbcom-neo4j-editor-options/ui/functions.js index 07d6432b1a..2ac145aaef 100644 --- a/charts/kubedbcom-neo4j-editor-options/ui/functions.js +++ b/charts/kubedbcom-neo4j-editor-options/ui/functions.js @@ -466,12 +466,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Neo4j/mode/toggle`)) { let defMode = getDefault('databases/Neo4j/mode') || '' if (defMode === '') { @@ -919,6 +913,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1090,6 +1107,7 @@ export const useFunc = (model) => { setBackup, showAdditionalSettings, getDefault, + initDeletionPolicy, checkHostnameOrIP, onArchiverChange, showArchiverAlert, diff --git a/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml b/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml index 01978ab8d6..397faedcac 100644 --- a/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-oracle-editor-options/ui/create-ui.yaml @@ -120,27 +120,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-oracle-editor-options/ui/functions.js b/charts/kubedbcom-oracle-editor-options/ui/functions.js index 4463833e3a..988ae5771e 100644 --- a/charts/kubedbcom-oracle-editor-options/ui/functions.js +++ b/charts/kubedbcom-oracle-editor-options/ui/functions.js @@ -539,12 +539,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Oracle/mode/toggle`)) { let defMode = getDefault('databases/Oracle/mode') || '' if (defMode === '') { @@ -991,6 +985,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1169,6 +1186,7 @@ export const useFunc = (model) => { setBackup, showAdditionalSettings, getDefault, + initDeletionPolicy, checkHostnameOrIP, onArchiverChange, showArchiverAlert, diff --git a/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml b/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml index 8f5df98765..2a0294d6d8 100644 --- a/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-perconaxtradb-editor-options/ui/create-ui.yaml @@ -107,27 +107,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: @@ -255,7 +251,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js b/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js index 418ae54547..a30aa03fa5 100644 --- a/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js +++ b/charts/kubedbcom-perconaxtradb-editor-options/ui/functions.js @@ -617,12 +617,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/PerconaXtraDB/mode/toggle`)) { let defMode = getDefault('databases/PerconaXtraDB/mode') || '' if (defMode === '') { @@ -909,6 +903,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1011,5 +1028,6 @@ export const useFunc = (model) => { setStorageClass, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml b/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml index 4fa3d004bd..5d7e4ed669 100644 --- a/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-pgbouncer-editor-options/ui/create-ui.yaml @@ -126,24 +126,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups + value: Halt + - text: Delete — Deletes pods, services & data; retains secrets & backups value: Delete - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select - if: diff --git a/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js b/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js index 431533a9ff..4e74e0faeb 100644 --- a/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js +++ b/charts/kubedbcom-pgbouncer-editor-options/ui/functions.js @@ -628,12 +628,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/PgBouncer/mode/toggle`)) { let defMode = getDefault('databases/PgBouncer/mode') || '' if (defMode === '') { @@ -928,6 +922,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1026,5 +1043,6 @@ export const useFunc = (model) => { clearConfiguration, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml index e3c4951d7d..000e2bde5c 100644 --- a/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-pgpool-editor-options/ui/create-ui.yaml @@ -130,27 +130,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-pgpool-editor-options/ui/functions.js b/charts/kubedbcom-pgpool-editor-options/ui/functions.js index fe67850f18..01e73f450d 100644 --- a/charts/kubedbcom-pgpool-editor-options/ui/functions.js +++ b/charts/kubedbcom-pgpool-editor-options/ui/functions.js @@ -556,12 +556,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Pgpool/mode/toggle`)) { let defMode = getDefault('databases/Pgpool/mode') || '' if (defMode === '') { @@ -964,6 +958,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1064,5 +1081,6 @@ export const useFunc = (model) => { showAdditionalSettings, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml b/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml index de8ef23e2b..dd011075f0 100644 --- a/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-postgres-editor-options/ui/create-ui.yaml @@ -139,28 +139,25 @@ step: type: object-item label: Labels & Annotations showLabels: true + hideBlock: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-postgres-editor-options/ui/functions.js b/charts/kubedbcom-postgres-editor-options/ui/functions.js index 68fa25d880..b760258be9 100644 --- a/charts/kubedbcom-postgres-editor-options/ui/functions.js +++ b/charts/kubedbcom-postgres-editor-options/ui/functions.js @@ -700,12 +700,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Postgres/mode/toggle`)) { let defMode = getDefault('databases/Postgres/mode') || '' if (defMode === '') { @@ -1107,6 +1101,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function convertToUTC(localTime) { const date = new Date(localTime) if (isNaN(date.getTime())) return @@ -1394,6 +1411,7 @@ export const useFunc = (model) => { setBackup, showAdditionalSettings, getDefault, + initDeletionPolicy, onArchiverChange, showArchiverAlert, showArchiver, diff --git a/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml b/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml index 71874a1c9e..9da729ea9f 100644 --- a/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-proxysql-editor-options/ui/create-ui.yaml @@ -122,24 +122,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups + value: Halt + - text: Delete — Deletes pods, services & data; retains secrets & backups value: Delete - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select - if: @@ -267,7 +266,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-proxysql-editor-options/ui/functions.js b/charts/kubedbcom-proxysql-editor-options/ui/functions.js index 2fc6d7a494..32f4f6e5df 100644 --- a/charts/kubedbcom-proxysql-editor-options/ui/functions.js +++ b/charts/kubedbcom-proxysql-editor-options/ui/functions.js @@ -669,12 +669,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/ProxySQL/mode/toggle`)) { let defMode = getDefault('databases/ProxySQL/mode') || '' if (defMode === '') { @@ -966,6 +960,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1070,5 +1087,6 @@ export const useFunc = (model) => { showAdditionalSettings, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml b/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml index 02af57d7a6..a0ab5dc339 100644 --- a/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-qdrant-editor-options/ui/create-ui.yaml @@ -120,27 +120,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-qdrant-editor-options/ui/functions.js b/charts/kubedbcom-qdrant-editor-options/ui/functions.js index 6e76126fcb..252b1242eb 100644 --- a/charts/kubedbcom-qdrant-editor-options/ui/functions.js +++ b/charts/kubedbcom-qdrant-editor-options/ui/functions.js @@ -639,12 +639,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Qdrant/mode/toggle`)) { let defMode = getDefault('databases/Qdrant/mode') || '' if (defMode === '') { @@ -980,6 +974,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -1073,5 +1090,6 @@ export const useFunc = (model) => { setBackup, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml b/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml index 0a7093a057..d623427a49 100644 --- a/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-rabbitmq-editor-options/ui/create-ui.yaml @@ -122,27 +122,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete ( Keep only database Secrets and backed up data ) - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt ( Keep PVCs, database Secrets and backed up data ) + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut ( Delete everything including backed up data ) + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate ( Prevent deletion of the RabbitMQ CRD ) - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: @@ -273,7 +269,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js b/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js index 8dd6bec885..66cf51ba14 100644 --- a/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js +++ b/charts/kubedbcom-rabbitmq-editor-options/ui/functions.js @@ -628,12 +628,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/RabbitMQ/mode/toggle`)) { let defMode = getDefault('databases/RabbitMQ/mode') || '' if (defMode === '') { @@ -949,6 +943,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1053,5 +1070,6 @@ export const useFunc = (model) => { showAdditionalSettings, getDefault, setServiceTemplate, + initDeletionPolicy, } } diff --git a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml index 020331ddf1..461859c9c3 100644 --- a/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-redis-editor-options/ui/create-ui.yaml @@ -204,27 +204,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete ( Keep only database Secrets and backed up data ) - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt ( Keep PVCs, database Secrets and backed up data ) + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut ( Delete everything including backed up data ) + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate ( Prevent deletion of the Redis CRD ) - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: @@ -352,7 +348,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-redis-editor-options/ui/functions.js b/charts/kubedbcom-redis-editor-options/ui/functions.js index c7e86d825f..2e88686835 100644 --- a/charts/kubedbcom-redis-editor-options/ui/functions.js +++ b/charts/kubedbcom-redis-editor-options/ui/functions.js @@ -488,6 +488,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -689,12 +712,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Redis/mode/toggle`)) { let defMode = getDefault('databases/Redis/mode') || '' if (defMode === '') { @@ -1174,6 +1191,7 @@ export const useFunc = (model) => { getIssuers, getAdminOptions, getDefault, + initDeletionPolicy, getDefaultValue, getMachineListForOptions, getNodeTopology, diff --git a/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml b/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml index a32cfe0412..2ace34063c 100644 --- a/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-singlestore-editor-options/ui/create-ui.yaml @@ -262,27 +262,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: @@ -412,7 +408,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-singlestore-editor-options/ui/functions.js b/charts/kubedbcom-singlestore-editor-options/ui/functions.js index dac6663ea8..f3600dcfb4 100644 --- a/charts/kubedbcom-singlestore-editor-options/ui/functions.js +++ b/charts/kubedbcom-singlestore-editor-options/ui/functions.js @@ -410,6 +410,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -581,12 +604,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Singlestore/mode/toggle`)) { let defMode = getDefault('databases/Singlestore/mode') || '' if (defMode === '') { @@ -1078,6 +1095,7 @@ export const useFunc = (model) => { dedicatedOnChange, filterNodeTopology, getDefault, + initDeletionPolicy, getDefaultValue, getMachineListForOptions, getReferSecrets, diff --git a/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml b/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml index 3d0d4f43f6..101056ec40 100644 --- a/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-solr-editor-options/ui/create-ui.yaml @@ -322,27 +322,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-solr-editor-options/ui/functions.js b/charts/kubedbcom-solr-editor-options/ui/functions.js index 1cf983ffbd..a5c71dfcad 100644 --- a/charts/kubedbcom-solr-editor-options/ui/functions.js +++ b/charts/kubedbcom-solr-editor-options/ui/functions.js @@ -406,6 +406,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + function getDefaultValue(path) { const val = getValue(model, `/${path}`) || '' return val @@ -515,12 +538,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Solr/mode/toggle`)) { let defMode = getDefault('databases/Solr/mode') || '' if (defMode === '') { @@ -1069,6 +1086,7 @@ export const useFunc = (model) => { filterNodeTopology, getAppBindings, getDefault, + initDeletionPolicy, getDefaultValue, getMachineListForOptions, getReferSecrets, diff --git a/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml b/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml index 2350068d55..fc9d0434da 100644 --- a/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-weaviate-editor-options/ui/create-ui.yaml @@ -116,27 +116,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: Keep only database Secrets and backed up data. - text: Delete - value: Delete - - description: Keep PVCs, database Secrets and backed up data. - text: Halt + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: Delete everything including backed up data. - text: WipeOut + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: Prevent deletion of the Weaviate CRD. - text: DoNotTerminate - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: diff --git a/charts/kubedbcom-weaviate-editor-options/ui/functions.js b/charts/kubedbcom-weaviate-editor-options/ui/functions.js index 2b827776df..78bcbcd9b4 100644 --- a/charts/kubedbcom-weaviate-editor-options/ui/functions.js +++ b/charts/kubedbcom-weaviate-editor-options/ui/functions.js @@ -457,12 +457,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/Weaviate/mode/toggle`)) { let defMode = getDefault('databases/Weaviate/mode') || '' if (defMode === '') { @@ -883,6 +877,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -904,8 +921,7 @@ export const useFunc = (model) => { const items = resp.data?.items || [] items.forEach((ele) => { const keys = Object.keys(ele.data || {}) - if (keys.includes('AUTHENTICATION_APIKEY_ALLOWED_KEYS')) - options.push(ele.metadata?.name) + if (keys.includes('AUTHENTICATION_APIKEY_ALLOWED_KEYS')) options.push(ele.metadata?.name) }) } catch (e) { console.log(e) @@ -1050,6 +1066,7 @@ export const useFunc = (model) => { setStorageClass, setBackup, getDefault, + initDeletionPolicy, checkHostnameOrIP, onArchiverChange, showArchiverAlert, diff --git a/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml b/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml index 2fef396f75..aa1d48d18e 100644 --- a/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml +++ b/charts/kubedbcom-zookeeper-editor-options/ui/create-ui.yaml @@ -118,27 +118,23 @@ step: label: Labels & Annotations showLabels: true type: block-layout - - customClass: mt-20 + - customClass: mt-16 if: name: isToggleOn|deletionPolicy type: function init: type: func - value: getDefault|deletionPolicy + value: initDeletionPolicy label: Deletion Policy options: - - description: options.deletionPolicy.delete.description - text: Delete ( Keep only database Secrets and backed up data ) - value: Delete - - description: options.deletionPolicy.halt.description - text: Halt ( Keep PVCs, database Secrets and backed up data ) + - text: DoNotTerminate — Blocks deletion; protects against accidental removal + value: DoNotTerminate + - text: Halt — Deletes pods & services; retains data, secrets & backups value: Halt - - description: options.deletionPolicy.wipeOut.description - text: WipeOut ( Delete everything including backed up data ) + - text: Delete — Deletes pods, services & data; retains secrets & backups + value: Delete + - text: WipeOut — Deletes everything, including data, secrets & backups value: WipeOut - - description: options.deletionPolicy.doNotTerminate.description - text: DoNotTerminate ( Prevent deletion of the ZooKeeper CRD ) - value: DoNotTerminate schema: schema/properties/spec/properties/deletionPolicy type: select watcher: @@ -272,7 +268,7 @@ step: label: Service Templates showLabels: true type: block-layout - hideBlock: true + hideBlock: false label: Advanced Configuration showLabels: true type: block-layout diff --git a/charts/kubedbcom-zookeeper-editor-options/ui/functions.js b/charts/kubedbcom-zookeeper-editor-options/ui/functions.js index b0118f2edd..dec74e62ba 100644 --- a/charts/kubedbcom-zookeeper-editor-options/ui/functions.js +++ b/charts/kubedbcom-zookeeper-editor-options/ui/functions.js @@ -611,12 +611,6 @@ export const useFunc = (model) => { console.log(e) } - commit('wizard/model$update', { - path: '/spec/deletionPolicy', - value: getDefault('deletionPolicy'), - force: true, - }) - if (!getValue(model, `/spec/admin/databases/ZooKeeper/mode/toggle`)) { let defMode = getDefault('databases/ZooKeeper/mode') || '' if (defMode === '') { @@ -961,6 +955,29 @@ export const useFunc = (model) => { return val } + function initDeletionPolicy() { + const deletionPolicy = getDefault('deletionPolicy') + const options = { + DoNotTerminate: { + text: 'DoNotTerminate — Blocks deletion; protects against accidental removal', + value: 'DoNotTerminate', + }, + Halt: { + text: 'Halt — Deletes pods & services; retains data, secrets & backups', + value: 'Halt', + }, + Delete: { + text: 'Delete — Deletes pods, services & data; retains secrets & backups', + value: 'Delete', + }, + WipeOut: { + text: 'WipeOut — Deletes everything, including data, secrets & backups', + value: 'WipeOut', + }, + } + return options[deletionPolicy] || options.WipeOut + } + async function getReferSecrets() { const referSecret = getValue(discriminator, '/referSecret') if (!referSecret) { @@ -1071,6 +1088,7 @@ export const useFunc = (model) => { setBackup, showAdditionalSettings, getDefault, + initDeletionPolicy, setResourceLimit, setServiceTemplate, }