diff --git a/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml index 1402c51bed..f4a0e448a7 100644 --- a/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml @@ -393,6 +393,30 @@ step: - type: input label: Value schema: schema/properties/spec/properties/verticalScaling/properties/routers/properties/topology/properties/value + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-druidopsrequest-editor/ui/functions.js b/charts/opskubedbcom-druidopsrequest-editor/ui/functions.js index a972ea100d..5cf6f25562 100644 --- a/charts/opskubedbcom-druidopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-druidopsrequest-editor/ui/functions.js @@ -1654,6 +1654,31 @@ export const useFunc = (model) => { } } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + // ============================================================ // RETURN ALL EXPORTED FUNCTIONS // ============================================================ @@ -1704,6 +1729,8 @@ export const useFunc = (model) => { // Vertical scaling functions isVerticalScaleTopologyRequired, + setExporter, + onExporterResourceChange, // Volume expansion functions checkVolume, diff --git a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml index 755b0239a3..77cbe987a8 100644 --- a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/create-ui.yaml @@ -860,34 +860,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|dataWarm schema: temp/topologyValue-dataWarm - - type: horizontal-layout - showLabels: true + - type: block-layout label: Exporter + showLabels: true + hideBlock: true elements: - - type: input - label: CPU Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/cpu|/spec/verticalScaling/exporter/resources/requests/cpu - - type: input - label: CPU Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/cpu|/spec/verticalScaling/exporter/resources/limits/cpu - - type: input - label: Memory Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/memory|/spec/verticalScaling/exporter/resources/requests/memory - - type: input - label: Memory Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/memory|/spec/verticalScaling/exporter/resources/limits/memory + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout diff --git a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/functions.js b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/functions.js index 2dd17475e7..74714e7c9f 100644 --- a/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-elasticsearchopsrequest-editor/ui/functions.js @@ -1557,6 +1557,31 @@ export const useFunc = (model) => { return !!topology[type]?.storage } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + // ===================================================== // Return all exported functions // ===================================================== @@ -1616,6 +1641,8 @@ export const useFunc = (model) => { // Vertical scaling functions isVerticalScaleTopologyRequired, + setExporter, + onExporterResourceChange, // Volume expansion functions checkVolume, diff --git a/charts/opskubedbcom-ferretdbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-ferretdbopsrequest-editor/ui/create-ui.yaml index 752ae5b83a..0e4aea9ee8 100644 --- a/charts/opskubedbcom-ferretdbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-ferretdbopsrequest-editor/ui/create-ui.yaml @@ -256,6 +256,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|secondary schema: temp/topologyValue-secondary + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Reconfigure TLS - type: block-layout label: TLS diff --git a/charts/opskubedbcom-ferretdbopsrequest-editor/ui/functions.js b/charts/opskubedbcom-ferretdbopsrequest-editor/ui/functions.js index 035d860bb1..044dc36a99 100644 --- a/charts/opskubedbcom-ferretdbopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-ferretdbopsrequest-editor/ui/functions.js @@ -1192,7 +1192,34 @@ export const useFunc = (model) => { return !!(model && model.alias) } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml index 0de699b4ad..176e78fcda 100644 --- a/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml @@ -335,6 +335,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|controller schema: temp/topologyValue-controller + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-kafkaopsrequest-editor/ui/functions.js b/charts/opskubedbcom-kafkaopsrequest-editor/ui/functions.js index 35b7b61fba..27ca96fb15 100644 --- a/charts/opskubedbcom-kafkaopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-kafkaopsrequest-editor/ui/functions.js @@ -1362,7 +1362,34 @@ export const useFunc = (model) => { return !!(model && model.alias) } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml index 1afdbc1253..b020540266 100644 --- a/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mariadbopsrequest-editor/ui/create-ui.yaml @@ -191,34 +191,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue - - type: horizontal-layout - showLabels: true + - type: block-layout label: Exporter + showLabels: true + hideBlock: true elements: - - type: input - label: CPU Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/cpu|/spec/verticalScaling/exporter/resources/requests/cpu - - type: input - label: CPU Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/cpu|/spec/verticalScaling/exporter/resources/limits/cpu - - type: input - label: Memory Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/memory|/spec/verticalScaling/exporter/resources/requests/memory - - type: input - label: Memory Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/memory|/spec/verticalScaling/exporter/resources/limits/memory + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-mariadbopsrequest-editor/ui/functions.js b/charts/opskubedbcom-mariadbopsrequest-editor/ui/functions.js index 3437804486..3d9cd17b84 100644 --- a/charts/opskubedbcom-mariadbopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-mariadbopsrequest-editor/ui/functions.js @@ -1322,7 +1322,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml index c2a8231a6c..cce12ccad9 100644 --- a/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-memcachedopsrequest-editor/ui/create-ui.yaml @@ -164,6 +164,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Reconfigure - type: block-layout label: Reconfigure Form diff --git a/charts/opskubedbcom-memcachedopsrequest-editor/ui/functions.js b/charts/opskubedbcom-memcachedopsrequest-editor/ui/functions.js index b441ce4b09..debe64061b 100644 --- a/charts/opskubedbcom-memcachedopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-memcachedopsrequest-editor/ui/functions.js @@ -1106,7 +1106,34 @@ export const useFunc = (model) => { } } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchJsons, returnFalse, isRancherManaged, diff --git a/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml index 7adc2dc74d..6b62097a6f 100644 --- a/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mongodbopsrequest-editor/ui/create-ui.yaml @@ -511,6 +511,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|shard schema: temp/topologyValue-shard + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout diff --git a/charts/opskubedbcom-mongodbopsrequest-editor/ui/functions.js b/charts/opskubedbcom-mongodbopsrequest-editor/ui/functions.js index 6c91370085..6698bc4abf 100644 --- a/charts/opskubedbcom-mongodbopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-mongodbopsrequest-editor/ui/functions.js @@ -1635,6 +1635,9 @@ export const useFunc = (model) => { function setValueFromDbDetails(path, commitPath) { const retValue = getValue(discriminator, `/dbDetails${path}`) + console.log(getValue(discriminator, '/dbDetails')) + + console.log(path) if (commitPath) { const tlsOperation = getValue(discriminator, '/tlsOperation') @@ -1845,7 +1848,34 @@ export const useFunc = (model) => { } } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml index bdb72f8280..18e580b1ce 100644 --- a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/create-ui.yaml @@ -191,6 +191,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory - type: horizontal-layout showLabels: true label: Exporter diff --git a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/functions.js b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/functions.js index 6aca4e21f1..dbfcd2721c 100644 --- a/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-mssqlserveropsrequest-editor/ui/functions.js @@ -1303,8 +1303,35 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { isRancherManaged, + setExporter, + onExporterResourceChange, setResource, fetchJsons, returnFalse, diff --git a/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml index 3a383b01fc..f7958aff64 100644 --- a/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-mysqlopsrequest-editor/ui/create-ui.yaml @@ -198,6 +198,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory - type: horizontal-layout showLabels: true label: Exporter diff --git a/charts/opskubedbcom-mysqlopsrequest-editor/ui/functions.js b/charts/opskubedbcom-mysqlopsrequest-editor/ui/functions.js index b4907b2b63..2f770b5c53 100644 --- a/charts/opskubedbcom-mysqlopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-mysqlopsrequest-editor/ui/functions.js @@ -1355,7 +1355,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml index ca289c4895..35cd01b68e 100644 --- a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/create-ui.yaml @@ -205,6 +205,30 @@ step: init: type: func value: setValueFromDbDetails|/spec/coordinator/resources/limits/memory|/spec/verticalScaling/coordinator/resources/limits/memory + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/functions.js b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/functions.js index c464090a22..ad61d28268 100644 --- a/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-perconaxtradbopsrequest-editor/ui/functions.js @@ -1322,7 +1322,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml index 59dee71964..b5817a0bc5 100644 --- a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/create-ui.yaml @@ -189,38 +189,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|pgbouncer schema: temp/topologyValue-pgbouncer - - type: horizontal-layout - showLabels: true + - type: block-layout label: Exporter - # schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources - # init: - # type: func - # value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources|/spec/verticalScaling/exporter/resources + showLabels: true + hideBlock: true elements: - - type: input - label: CPU Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/cpu|/spec/verticalScaling/exporter/resources/requests/cpu - - type: input - label: CPU Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/cpu|/spec/verticalScaling/exporter/resources/limits/cpu - - type: input - label: Memory Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/memory|/spec/verticalScaling/exporter/resources/requests/memory - - type: input - label: Memory Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/memory|/spec/verticalScaling/exporter/resources/limits/memory + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Reconfigure - type: block-layout label: Reconfigure Form diff --git a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/functions.js b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/functions.js index 9466942e0a..b3cfd26fc5 100644 --- a/charts/opskubedbcom-pgbounceropsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-pgbounceropsrequest-editor/ui/functions.js @@ -1267,7 +1267,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions: getAliasOptions, isRancherManaged, fetchJsons, diff --git a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml index 8fd9e522fc..ae87f4a54f 100644 --- a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/create-ui.yaml @@ -191,6 +191,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Reconfigure - type: block-layout label: Reconfigure Form diff --git a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/functions.js b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/functions.js index 69a2d3fe99..e4d5dfb5d1 100644 --- a/charts/opskubedbcom-pgpoolopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-pgpoolopsrequest-editor/ui/functions.js @@ -1296,7 +1296,34 @@ export const useFunc = (model) => { return !!(model && model.alias) } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml index dd4381de86..d97b7ee8ac 100644 --- a/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-postgresopsrequest-editor/ui/create-ui.yaml @@ -194,38 +194,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue - - type: horizontal-layout - showLabels: true + - type: block-layout label: Exporter - # schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources - # init: - # type: func - # value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources|/spec/verticalScaling/exporter/resources + showLabels: true + hideBlock: true elements: - - type: input - label: CPU Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/cpu|/spec/verticalScaling/exporter/resources/requests/cpu - - type: input - label: CPU Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/cpu|/spec/verticalScaling/exporter/resources/limits/cpu - - type: input - label: Memory Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/memory|/spec/verticalScaling/exporter/resources/requests/memory - - type: input - label: Memory Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/memory|/spec/verticalScaling/exporter/resources/limits/memory + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-postgresopsrequest-editor/ui/functions.js b/charts/opskubedbcom-postgresopsrequest-editor/ui/functions.js index 8f9ef50172..1a90834668 100644 --- a/charts/opskubedbcom-postgresopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-postgresopsrequest-editor/ui/functions.js @@ -1407,7 +1407,34 @@ export const useFunc = (model) => { isDbDetailsLoading() } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, dbDetailsWatcherFunction, tlsOperationWatcherFunction, namespaceWatcherFunctions, diff --git a/charts/opskubedbcom-proxysqlopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-proxysqlopsrequest-editor/ui/create-ui.yaml index 12514eb71a..62ef384946 100644 --- a/charts/opskubedbcom-proxysqlopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-proxysqlopsrequest-editor/ui/create-ui.yaml @@ -188,6 +188,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|proxysql schema: temp/topologyValue-proxysql + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Reconfigure - type: block-layout label: Reconfigure Form diff --git a/charts/opskubedbcom-proxysqlopsrequest-editor/ui/functions.js b/charts/opskubedbcom-proxysqlopsrequest-editor/ui/functions.js index ffb8fcc953..c34f341706 100644 --- a/charts/opskubedbcom-proxysqlopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-proxysqlopsrequest-editor/ui/functions.js @@ -1213,7 +1213,34 @@ export const useFunc = (model) => { return !!(model && model.alias) } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml index 9e722236aa..656b3d080b 100644 --- a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/create-ui.yaml @@ -198,6 +198,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/functions.js b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/functions.js index d4e2dcf3f1..f5dc08db2d 100644 --- a/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-rabbitmqopsrequest-editor/ui/functions.js @@ -1318,7 +1318,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml index db2b979200..2d2c0d732f 100644 --- a/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-redisopsrequest-editor/ui/create-ui.yaml @@ -201,34 +201,30 @@ step: - type: input label: Value schema: temp/topologyValue - - type: horizontal-layout - showLabels: true + - type: block-layout label: Exporter + showLabels: true + hideBlock: true elements: - - type: input - label: CPU Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/cpu|/spec/verticalScaling/exporter/resources/requests/cpu - - type: input - label: CPU Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/cpu - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/cpu|/spec/verticalScaling/exporter/resources/limits/cpu - - type: input - label: Memory Requests - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/requests/memory|/spec/verticalScaling/exporter/resources/requests/memory - - type: input - label: Memory Limits - schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/memory - init: - type: func - value: setValueFromDbDetails|/spec/monitor/prometheus/exporter/resources/limits/memory|/spec/verticalScaling/exporter/resources/limits/memory + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-redisopsrequest-editor/ui/functions.js b/charts/opskubedbcom-redisopsrequest-editor/ui/functions.js index d638bef91d..b42e20e859 100644 --- a/charts/opskubedbcom-redisopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-redisopsrequest-editor/ui/functions.js @@ -1318,7 +1318,34 @@ export const useFunc = (model) => { return !!(model && model.alias) } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml index a258505534..bbf4336ac9 100644 --- a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/create-ui.yaml @@ -349,6 +349,30 @@ step: paths: - temp/properties/machine-coordinator schema: temp/properties/machine-coordinator + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout label: Volume Expansion Form diff --git a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/functions.js b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/functions.js index 4ff6616b3d..741bf1c296 100644 --- a/charts/opskubedbcom-singlestoreopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-singlestoreopsrequest-editor/ui/functions.js @@ -1369,7 +1369,34 @@ export const useFunc = (model) => { } } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml index f95dca1fcb..18acb745de 100644 --- a/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-solropsrequest-editor/ui/create-ui.yaml @@ -438,6 +438,30 @@ step: type: custom name: isVerticalScaleTopologyRequired|overseer schema: temp/topologyValue-overseer + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout diff --git a/charts/opskubedbcom-solropsrequest-editor/ui/functions.js b/charts/opskubedbcom-solropsrequest-editor/ui/functions.js index 9d39e09096..c1c6c16de5 100644 --- a/charts/opskubedbcom-solropsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-solropsrequest-editor/ui/functions.js @@ -1363,7 +1363,34 @@ export const useFunc = (model) => { return data || 'No Data Found' } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, fetchAliasOptions, validateNewCertificates, disableAlias, diff --git a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml index 427b1a673c..f2e4a49ea3 100644 --- a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml +++ b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/create-ui.yaml @@ -191,6 +191,30 @@ step: type: custom name: isVerticalScaleTopologyRequired schema: temp/topologyValue + - type: block-layout + label: Exporter + showLabels: true + hideBlock: true + elements: + - type: horizontal-layout + showLabels: true + elements: + - init: + type: func + value: setExporter|cpu + type: input + label: CPU + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/requests/properties/cpu + - type: input + init: + type: func + value: setExporter|memory + label: Memory + schema: schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory + watcher: + func: onExporterResourceChange|memory + paths: + - schema/properties/spec/properties/verticalScaling/properties/exporter/properties/resources/properties/limits/properties/memory # Volume Expansion - type: block-layout diff --git a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/functions.js b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/functions.js index 8525680046..bb57799eb2 100644 --- a/charts/opskubedbcom-zookeeperopsrequest-editor/ui/functions.js +++ b/charts/opskubedbcom-zookeeperopsrequest-editor/ui/functions.js @@ -1175,7 +1175,34 @@ export const useFunc = (model) => { return value * units[unit] } + function setExporter(type) { + let path = `/dbDetails/spec/monitor/prometheus/exporter/resources/limits/${type}` + const limitVal = getValue(discriminator, path) + + if (!limitVal) { + path = `/dbDetails/spec/monitor/prometheus/exporter/resources/requests/${type}` + const reqVal = getValue(discriminator, path) + + if (reqVal) return reqVal + } + return limitVal + } + + function onExporterResourceChange(type) { + const commitPath = `/spec/verticalScaling/exporter/resources/requests/${type}` + const valPath = `/spec/verticalScaling/exporter/resources/limits/${type}` + const val = getValue(model, valPath) + if (val) + commit('wizard/model$update', { + path: commitPath, + value: val, + force: true, + }) + } + return { + setExporter, + onExporterResourceChange, returnFalse, getNamespaces, getDbs,