From f582a638e0cf65ab2c3a5f5653aaea976dabcb47 Mon Sep 17 00:00:00 2001 From: rafi Date: Fri, 24 Apr 2026 12:03:09 +0600 Subject: [PATCH 01/11] Add monitoring cluster to appscode otel stack featureset Signed-off-by: rafi --- .../ui/create-ui.yaml | 59 +++++++----- .../ui/functions.js | 96 ++++++++++++++++++- 2 files changed, 131 insertions(+), 24 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index 2262c411b0..429e7379c6 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -1,25 +1,38 @@ step: -- elements: - - individualDisability: disableFeatures - init: - type: func - value: getEnabledFeatures - label: "" - loader: fetchFeatureSetOptions - schema: temp/properties/enabledFeatures - type: checkbox - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/enabledFeatures - - customClass: mt-24 - label: 'Note: Enabling a feature auto enables any prerequisite features' - type: info - watcher: - func: checkIsResourceLoaded - paths: - - temp/properties/isResourceLoaded - id: opscenter-monitoring - loader: setReleaseNameAndNamespaceAndInitializeValues - type: single-step-form + - loader: setReleaseNameAndNamespaceAndInitializeValues + type: single-step-form + id: opscenter-monitoring + elements: + - type: checkbox + schema: temp/properties/enabledFeatures + label: '' + loader: fetchFeatureSetOptions + individualDisability: disableFeatures + init: + type: func + value: getEnabledFeatures + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/enabledFeatures + - type: info + customClass: mt-24 + label: 'Note: Enabling a feature auto enables any prerequisite features' + watcher: + func: checkIsResourceLoaded + paths: + - temp/properties/isResourceLoaded + - type: select + if: + name: checkIsOtelStackEnabled + type: function + loader: fetchMonitoringClusterOptions + label: Select Monitoring Cluster + schema: temp/properties/monitoringClusterName + watcher: + func: onMonitoringClusterChange + paths: + - temp/properties/monitoringClusterName + validation: + type: required type: multi-step-form diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 52d045e26b..feda424ecb 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -8,6 +8,7 @@ export const useFunc = (model) => { setDiscriminatorValue('/enabledFeatures', []) setDiscriminatorValue('/isResourceLoaded', false) + const appsCodeOtelStack = 'appscode-otel-stack' let resources = {} // get specific feature details @@ -210,8 +211,43 @@ export const useFunc = (model) => { return resourceValuePath } + function deepMergeValues(existingValues, newValues) { + if (!newValues) return existingValues + if (!existingValues) return newValues + + const merged = { ...existingValues } + + Object.keys(newValues).forEach((key) => { + if ( + typeof newValues[key] === 'object' && + newValues[key] !== null && + !Array.isArray(newValues[key]) + ) { + merged[key] = deepMergeValues(existingValues[key], newValues[key]) + } else { + merged[key] = newValues[key] + } + }) + + return merged + } + + // fetch monitoring cluster configuration + async function fetchMonitoringClusterConfig(monitoringClusterName) { + if (!monitoringClusterName) { + return null + } + + const owner = storeGet('/route/params/user') + const cluster = storeGet('/route/params/cluster') + const { data } = await axios.get(`/telemetry/${owner}/${cluster}/values/appscode-otel-stack`) + return data + } + function onEnabledFeaturesChange() { const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] + const monitoringClusterName = getValue(discriminator, '/monitoringClusterName') + let monitoringClusterConfig = getValue(discriminator, '/monitoringClusterConfig') const allFeatures = storeGet('/cluster/features/result') || [] @@ -233,6 +269,23 @@ export const useFunc = (model) => { if (isEnabled && !isManaged) { commit('wizard/model$delete', `/resources/${resourceValuePath}`) } else { + // Merge existing values with otelStack data only for appscode-otel-stack feature + const initialResourceValues = resources?.[resourceValuePath]?.spec?.values + let mergedResourceValues = initialResourceValues + + let finalSourceRef = sourceRef + if ( + featureName === appsCodeOtelStack && + monitoringClusterName && + monitoringClusterConfig + ) { + mergedResourceValues = deepMergeValues(initialResourceValues, monitoringClusterConfig) + finalSourceRef = { + ...sourceRef, + monitoringCluster: monitoringClusterName, + } + } + commit('wizard/model$update', { path: `/resources/${resourceValuePath}`, value: { @@ -247,10 +300,11 @@ export const useFunc = (model) => { }, spec: { ...resources?.[resourceValuePath]?.spec, + values: mergedResourceValues, chart: { spec: { chart, - sourceRef, + sourceRef: finalSourceRef, version, }, }, @@ -367,6 +421,43 @@ export const useFunc = (model) => { } } + //this function is used to check if AppsCode OpenTelemetry Stack is enabled + //it is the condition to show monitoring cluster dropdown + function checkIsOtelStackEnabled() { + // watchDependency('discriminator#/enabledFeatures') + const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] + if (enabledFeatures.includes(appsCodeOtelStack)) { + return true + } + return false + } + + //this function is used to fetch monitoring cluster options from dropdown + async function fetchMonitoringClusterOptions() { + const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] + if (!enabledFeatures.includes(appsCodeOtelStack)) { + return [] + } + + const owner = storeGet('/route/params/user') + let url = `/telemetry/${owner}/monitoring-clusters` + const { data } = await axios.get(url) + + return data || [] + } + + async function onMonitoringClusterChange() { + const monitoringClusterName = getValue(discriminator, '/monitoringClusterName') + if (!monitoringClusterName) { + return + } + + const data = await fetchMonitoringClusterConfig(monitoringClusterName) + + setDiscriminatorValue('/monitoringClusterConfig', data) + onEnabledFeaturesChange() + } + return { hideThisElement, checkIsResourceLoaded, @@ -380,5 +471,8 @@ export const useFunc = (model) => { returnFalse, setReleaseNameAndNamespaceAndInitializeValues, fetchFeatureSetOptions, + checkIsOtelStackEnabled, + fetchMonitoringClusterOptions, + onMonitoringClusterChange, } } From c7fdf90f8145c4954abe48cd07b4d334eb6ad744 Mon Sep 17 00:00:00 2001 From: rafi Date: Fri, 24 Apr 2026 12:15:56 +0600 Subject: [PATCH 02/11] master rebase Signed-off-by: rafi --- .../ui/create-ui.yaml | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index 429e7379c6..78799bba8f 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -1,38 +1,38 @@ step: - - loader: setReleaseNameAndNamespaceAndInitializeValues - type: single-step-form - id: opscenter-monitoring - elements: - - type: checkbox - schema: temp/properties/enabledFeatures - label: '' - loader: fetchFeatureSetOptions - individualDisability: disableFeatures - init: - type: func - value: getEnabledFeatures - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/enabledFeatures - - type: info - customClass: mt-24 - label: 'Note: Enabling a feature auto enables any prerequisite features' - watcher: - func: checkIsResourceLoaded - paths: - - temp/properties/isResourceLoaded - - type: select - if: - name: checkIsOtelStackEnabled - type: function - loader: fetchMonitoringClusterOptions - label: Select Monitoring Cluster - schema: temp/properties/monitoringClusterName - watcher: - func: onMonitoringClusterChange - paths: - - temp/properties/monitoringClusterName - validation: - type: required +- elements: + - individualDisability: disableFeatures + init: + type: func + value: getEnabledFeatures + label: "" + loader: fetchFeatureSetOptions + schema: temp/properties/enabledFeatures + type: checkbox + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/enabledFeatures + - customClass: mt-24 + label: 'Note: Enabling a feature auto enables any prerequisite features' + type: info + watcher: + func: checkIsResourceLoaded + paths: + - temp/properties/isResourceLoaded + - type: select + if: + name: checkIsOtelStackEnabled + type: function + loader: fetchMonitoringClusterOptions + label: Select Monitoring Cluster + schema: temp/properties/monitoringClusterName + watcher: + func: onMonitoringClusterChange + paths: + - temp/properties/monitoringClusterName + validation: + type: required + id: opscenter-monitoring + loader: setReleaseNameAndNamespaceAndInitializeValues + type: single-step-form type: multi-step-form From 4126b2fbaf1e501466f766a3b7ba4aee56d98e31 Mon Sep 17 00:00:00 2001 From: RokibulHasan7 Date: Fri, 24 Apr 2026 15:14:29 +0600 Subject: [PATCH 03/11] Update values.yaml Signed-off-by: RokibulHasan7 --- .../values.yaml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/values.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/values.yaml index cc64606e02..7f70491af7 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/values.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/values.yaml @@ -195,6 +195,99 @@ resources: crds: CreateReplace remediation: retries: -1 + helmToolkitFluxcdIoHelmRelease_prom_label_proxy: # +doc-gen:break + apiVersion: helm.toolkit.fluxcd.io/v2 + kind: HelmRelease + metadata: + labels: + app.kubernetes.io/component: prom-label-proxy + name: prom-label-proxy + namespace: kubeops + spec: + chart: + spec: + chart: prom-label-proxy + sourceRef: + kind: HelmRepository + name: appscode-charts-oci + namespace: kubeops + version: v2025.4.30 + install: + crds: CreateReplace + createNamespace: true + remediation: + retries: -1 + interval: 5m + releaseName: prom-label-proxy + storageNamespace: monitoring + targetNamespace: monitoring + timeout: 30m + upgrade: + crds: CreateReplace + remediation: + retries: -1 + helmToolkitFluxcdIoHelmRelease_thanos_operator: # +doc-gen:break + apiVersion: helm.toolkit.fluxcd.io/v2 + kind: HelmRelease + metadata: + labels: + app.kubernetes.io/component: thanos-operator + name: thanos-operator + namespace: kubeops + spec: + chart: + spec: + chart: thanos-operator + sourceRef: + kind: HelmRepository + name: appscode-charts-oci + namespace: kubeops + version: v2025.4.30 + install: + crds: CreateReplace + createNamespace: true + remediation: + retries: -1 + interval: 5m + releaseName: thanos-operator + storageNamespace: monitoring + targetNamespace: monitoring + timeout: 30m + upgrade: + crds: CreateReplace + remediation: + retries: -1 + helmToolkitFluxcdIoHelmRelease_tenant_operator: # +doc-gen:break + apiVersion: helm.toolkit.fluxcd.io/v2 + kind: HelmRelease + metadata: + labels: + app.kubernetes.io/component: tenant-operator + name: tenant-operator + namespace: kubeops + spec: + chart: + spec: + chart: tenant-operator + sourceRef: + kind: HelmRepository + name: appscode-charts-oci + namespace: kubeops + version: v2025.4.30 + install: + crds: CreateReplace + createNamespace: true + remediation: + retries: -1 + interval: 5m + releaseName: tenant-operator + storageNamespace: monitoring + targetNamespace: monitoring + timeout: 30m + upgrade: + crds: CreateReplace + remediation: + retries: -1 helmToolkitFluxcdIoHelmRelease_kube_prometheus_stack: # +doc-gen:break apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease From c33231e2192e921165044bee2d0f5f805d8b1c2b Mon Sep 17 00:00:00 2001 From: rafi Date: Fri, 24 Apr 2026 19:05:33 +0600 Subject: [PATCH 04/11] Add prom label proxy and thanos operator featuresets Signed-off-by: rafi --- ...uxcd_io_helm_release_prom_label_proxy.yaml | 5 + ...luxcd_io_helm_release_tenant_operator.yaml | 5 + ...luxcd_io_helm_release_thanos_operator.yaml | 5 + .../ui/create-ui.yaml | 141 +++++++++++++----- .../ui/functions.js | 114 +++++++++++++- 5 files changed, 228 insertions(+), 42 deletions(-) create mode 100644 charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_prom_label_proxy.yaml create mode 100644 charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_tenant_operator.yaml create mode 100644 charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_thanos_operator.yaml diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_prom_label_proxy.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_prom_label_proxy.yaml new file mode 100644 index 0000000000..9da062a198 --- /dev/null +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_prom_label_proxy.yaml @@ -0,0 +1,5 @@ +{{- with .Values.resources }} +{{- with .helmToolkitFluxcdIoHelmRelease_prom_label_proxy }} +{{- . | toYaml }} +{{- end }} +{{- end }} diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_tenant_operator.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_tenant_operator.yaml new file mode 100644 index 0000000000..6be434417d --- /dev/null +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_tenant_operator.yaml @@ -0,0 +1,5 @@ +{{- with .Values.resources }} +{{- with .helmToolkitFluxcdIoHelmRelease_tenant_operator }} +{{- . | toYaml }} +{{- end }} +{{- end }} diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_thanos_operator.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_thanos_operator.yaml new file mode 100644 index 0000000000..9e906b7d19 --- /dev/null +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/templates/helm_toolkit_fluxcd_io_helm_release_thanos_operator.yaml @@ -0,0 +1,5 @@ +{{- with .Values.resources }} +{{- with .helmToolkitFluxcdIoHelmRelease_thanos_operator }} +{{- . | toYaml }} +{{- end }} +{{- end }} diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index 78799bba8f..f9f766913b 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -1,38 +1,107 @@ step: -- elements: - - individualDisability: disableFeatures - init: - type: func - value: getEnabledFeatures - label: "" - loader: fetchFeatureSetOptions - schema: temp/properties/enabledFeatures - type: checkbox - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/enabledFeatures - - customClass: mt-24 - label: 'Note: Enabling a feature auto enables any prerequisite features' - type: info - watcher: - func: checkIsResourceLoaded - paths: - - temp/properties/isResourceLoaded - - type: select - if: - name: checkIsOtelStackEnabled - type: function - loader: fetchMonitoringClusterOptions - label: Select Monitoring Cluster - schema: temp/properties/monitoringClusterName - watcher: - func: onMonitoringClusterChange - paths: - - temp/properties/monitoringClusterName - validation: - type: required - id: opscenter-monitoring - loader: setReleaseNameAndNamespaceAndInitializeValues - type: single-step-form + - elements: + - individualDisability: disableFeatures + init: + type: func + value: getEnabledFeatures + label: '' + loader: fetchFeatureSetOptions + schema: temp/properties/enabledFeatures + type: checkbox + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/enabledFeatures + - customClass: mt-24 + label: 'Note: Enabling a feature auto enables any prerequisite features' + type: info + watcher: + func: checkIsResourceLoaded + paths: + - temp/properties/isResourceLoaded + - type: select + if: + name: checkIsOtelStackEnabled + type: function + loader: fetchMonitoringClusterOptions + label: Select Monitoring Cluster + schema: temp/properties/monitoringClusterName + watcher: + func: onMonitoringClusterChange + paths: + - temp/properties/monitoringClusterName + validation: + type: required + - type: block-layout + if: + name: checkIsThanosOrPromLabelProxyEnabled + type: function + label: Object Storage Configuration + elements: + - type: select + label: Backend Provider + loader: fetchInitialObjStorageProvider + schema: temp/properties/objStorage/provider + options: + - text: s3 + value: s3 + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/provider + - type: input + label: Bucket + loader: fetchInitialObjStorageBucket + schema: temp/properties/objStorage/bucket + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/bucket + - type: input + label: Endpoint + loader: fetchInitialObjStorageEndpoint + schema: temp/properties/objStorage/endpoint + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/endpoint + - type: input + label: Access Key + loader: fetchInitialObjStorageAccessKey + schema: temp/properties/objStorage/accessKey + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/accessKey + - type: input + label: Secret Key + loader: fetchInitialObjStorageSecretKey + schema: temp/properties/objStorage/secretKey + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/secretKey + - type: input + label: Region + loader: fetchInitialObjStorageRegion + schema: temp/properties/objStorage/region + validation: + type: required + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/region + id: opscenter-monitoring + loader: setReleaseNameAndNamespaceAndInitializeValues + type: single-step-form type: multi-step-form diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index feda424ecb..428cf267d5 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -9,6 +9,11 @@ export const useFunc = (model) => { setDiscriminatorValue('/enabledFeatures', []) setDiscriminatorValue('/isResourceLoaded', false) const appsCodeOtelStack = 'appscode-otel-stack' + const thanosOperator = 'thanos-operator' + const promLabelProxy = 'prom-label-proxy' + + const thanosOperatorResPath = 'helmToolkitFluxcdIoHelmRelease_thanos_operator' + const promLabelProxyResPath = 'helmToolkitFluxcdIoHelmRelease_prom_label_proxy' let resources = {} // get specific feature details @@ -244,14 +249,15 @@ export const useFunc = (model) => { return data } - function onEnabledFeaturesChange() { + async function onEnabledFeaturesChange() { const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] const monitoringClusterName = getValue(discriminator, '/monitoringClusterName') let monitoringClusterConfig = getValue(discriminator, '/monitoringClusterConfig') + const objStorage = getValue(discriminator, '/objStorage') const allFeatures = storeGet('/cluster/features/result') || [] - allFeatures.forEach((item) => { + for (const item of allFeatures) { const featureName = item?.metadata?.name || '' const resourceValuePath = getResourceValuePathFromFeature(item) @@ -286,6 +292,48 @@ export const useFunc = (model) => { } } + if (featureName === thanosOperator && objStorage) { + const endpoint = (objStorage.endpoint || '').replace(/^https?:\/\//, '') + mergedResourceValues = deepMergeValues(initialResourceValues, { + objStorage: { + provider: objStorage.provider || 's3', + bucket: objStorage.bucket || '', + endpoint: endpoint, + accessKey: objStorage.accessKey || '', + secretKey: objStorage.secretKey || '', + region: objStorage.region || '', + }, + }) + } + + if (featureName === promLabelProxy && objStorage) { + const owner = storeGet('/route/params/user') + const cluster = storeGet('/route/params/cluster') + let telemetryHost = '' + try { + const { data } = await axios.get(`/telemetry/${owner}/${cluster}/stack/host`) + telemetryHost = data || '' + } catch (e) { + window.console.error('Failed to fetch telemetry host', e) + } + + mergedResourceValues = deepMergeValues(initialResourceValues, { + clickhouse: { + s3: { + provider: objStorage.provider || 's3', + bucket: objStorage.bucket || '', + endpoint: objStorage.endpoint || '', + accessKey: objStorage.accessKey || '', + secretKey: objStorage.secretKey || '', + region: objStorage.region || '', + }, + }, + infra: { + host: telemetryHost, + }, + }) + } + commit('wizard/model$update', { path: `/resources/${resourceValuePath}`, value: { @@ -317,7 +365,7 @@ export const useFunc = (model) => { } else { commit('wizard/model$delete', `/resources/${resourceValuePath}`) } - }) + } } function returnFalse() { @@ -413,11 +461,11 @@ export const useFunc = (model) => { // this computed's main purpose is to watch isResourceLoaded flag // and fire the onEnabledFeatureChange function when it's true - function checkIsResourceLoaded() { + async function checkIsResourceLoaded() { // watchDependency('discriminator#/isResourceLoaded') const isResourceLoaded = getValue(discriminator, '/isResourceLoaded') if (isResourceLoaded) { - onEnabledFeaturesChange() + await onEnabledFeaturesChange() } } @@ -455,7 +503,54 @@ export const useFunc = (model) => { const data = await fetchMonitoringClusterConfig(monitoringClusterName) setDiscriminatorValue('/monitoringClusterConfig', data) - onEnabledFeaturesChange() + await onEnabledFeaturesChange() + } + + function checkIsThanosOrPromLabelProxyEnabled() { + const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] + return enabledFeatures.includes(thanosOperator) || enabledFeatures.includes(promLabelProxy) + } + + function fetchInitialObjStorageProvider() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.provider || thanosValues.provider || 's3' + } + + function fetchInitialObjStorageBucket() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.bucket || thanosValues.bucket || '' + } + + function fetchInitialObjStorageEndpoint() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.endpoint || thanosValues.endpoint || '' + } + + function fetchInitialObjStorageRegion() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.region || thanosValues.region || '' + } + + function fetchInitialObjStorageAccessKey() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.accessKey || thanosValues.accessKey || '' + } + + function fetchInitialObjStorageSecretKey() { + const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} + + return promValues.secretKey || thanosValues.secretKey || '' } return { @@ -474,5 +569,12 @@ export const useFunc = (model) => { checkIsOtelStackEnabled, fetchMonitoringClusterOptions, onMonitoringClusterChange, + checkIsThanosOrPromLabelProxyEnabled, + fetchInitialObjStorageProvider, + fetchInitialObjStorageBucket, + fetchInitialObjStorageEndpoint, + fetchInitialObjStorageRegion, + fetchInitialObjStorageAccessKey, + fetchInitialObjStorageSecretKey, } } From f3f0858fe59716289b942b81229479085583f2b4 Mon Sep 17 00:00:00 2001 From: rafi Date: Mon, 27 Apr 2026 12:18:56 +0600 Subject: [PATCH 05/11] Add TLS config Signed-off-by: rafi --- .../ui/create-ui.yaml | 23 +++++++++- .../ui/functions.js | 44 ++++++++++++++++--- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index f9f766913b..752512ee07 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -40,8 +40,10 @@ step: elements: - type: select label: Backend Provider - loader: fetchInitialObjStorageProvider schema: temp/properties/objStorage/provider + init: + type: static + value: s3 options: - text: s3 value: s3 @@ -101,6 +103,25 @@ step: func: onEnabledFeaturesChange paths: - temp/properties/objStorage/region + - type: label-element + label: TLS Config (Client CA Certificate) + customClass: mt-16 font-semibold + - type: input + label: Secret Name + loader: fetchInitialObjStorageTlsSecretName + schema: temp/properties/objStorage/tlsSecretName + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/tlsSecretName + - type: input + label: Key + loader: fetchInitialObjStorageTlsKey + schema: temp/properties/objStorage/tlsKey + watcher: + func: onEnabledFeaturesChange + paths: + - temp/properties/objStorage/tlsKey id: opscenter-monitoring loader: setReleaseNameAndNamespaceAndInitializeValues type: single-step-form diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 428cf267d5..8fafeb322d 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -15,6 +15,7 @@ export const useFunc = (model) => { const thanosOperatorResPath = 'helmToolkitFluxcdIoHelmRelease_thanos_operator' const promLabelProxyResPath = 'helmToolkitFluxcdIoHelmRelease_prom_label_proxy' let resources = {} + let telemetryHostPromise = null // get specific feature details function getFeatureSetDetails() { @@ -309,13 +310,21 @@ export const useFunc = (model) => { if (featureName === promLabelProxy && objStorage) { const owner = storeGet('/route/params/user') const cluster = storeGet('/route/params/cluster') - let telemetryHost = '' - try { - const { data } = await axios.get(`/telemetry/${owner}/${cluster}/stack/host`) - telemetryHost = data || '' - } catch (e) { - window.console.error('Failed to fetch telemetry host', e) + if (!telemetryHostPromise) { + telemetryHostPromise = (async () => { + try { + const { data } = await axios.get(`/telemetry/${owner}/${cluster}/stack/host`) + return data || '' + } catch (e) { + window.console.error('Failed to fetch telemetry host', e) + return '' + } + })() } + const telemetryHost = await telemetryHostPromise + + const tlsSecretName = (objStorage.tlsSecretName || '').trim() + const tlsKey = (objStorage.tlsKey || '').trim() mergedResourceValues = deepMergeValues(initialResourceValues, { clickhouse: { @@ -327,6 +336,15 @@ export const useFunc = (model) => { secretKey: objStorage.secretKey || '', region: objStorage.region || '', }, + tls: + tlsSecretName && tlsKey + ? { + clientCaCertificateRefs: { + key: tlsKey, + name: tlsSecretName, + }, + } + : undefined, }, infra: { host: telemetryHost, @@ -553,6 +571,18 @@ export const useFunc = (model) => { return promValues.secretKey || thanosValues.secretKey || '' } + function fetchInitialObjStorageTlsSecretName() { + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} + const refs = promValues.clientCaCertificateRefs || [] + return refs[0]?.name || '' + } + + function fetchInitialObjStorageTlsKey() { + const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} + const refs = promValues.clientCaCertificateRefs || [] + return refs[0]?.key || '' + } + return { hideThisElement, checkIsResourceLoaded, @@ -576,5 +606,7 @@ export const useFunc = (model) => { fetchInitialObjStorageRegion, fetchInitialObjStorageAccessKey, fetchInitialObjStorageSecretKey, + fetchInitialObjStorageTlsSecretName, + fetchInitialObjStorageTlsKey, } } From 6015ba564ec441a81c89eafc79d86d57f9dba09f Mon Sep 17 00:00:00 2001 From: rafi Date: Mon, 27 Apr 2026 12:22:41 +0600 Subject: [PATCH 06/11] Make fields required Signed-off-by: rafi --- .../ui/create-ui.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index 752512ee07..f8fcef51dc 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -110,6 +110,8 @@ step: label: Secret Name loader: fetchInitialObjStorageTlsSecretName schema: temp/properties/objStorage/tlsSecretName + validation: + type: required watcher: func: onEnabledFeaturesChange paths: @@ -118,6 +120,8 @@ step: label: Key loader: fetchInitialObjStorageTlsKey schema: temp/properties/objStorage/tlsKey + validation: + type: required watcher: func: onEnabledFeaturesChange paths: From 1413cf56477f6f737d178386c651a4ead3f91045 Mon Sep 17 00:00:00 2001 From: rafi Date: Mon, 27 Apr 2026 20:10:20 +0600 Subject: [PATCH 07/11] fix tls certificate field condition Signed-off-by: rafi --- .../ui/create-ui.yaml | 13 +++++++++---- .../ui/functions.js | 14 ++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index f8fcef51dc..ab224b7229 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -104,24 +104,29 @@ step: paths: - temp/properties/objStorage/region - type: label-element + if: + name: checkIsPromLabelProxyEnabled + type: function label: TLS Config (Client CA Certificate) customClass: mt-16 font-semibold - type: input + if: + name: checkIsPromLabelProxyEnabled + type: function label: Secret Name loader: fetchInitialObjStorageTlsSecretName schema: temp/properties/objStorage/tlsSecretName - validation: - type: required watcher: func: onEnabledFeaturesChange paths: - temp/properties/objStorage/tlsSecretName - type: input + if: + name: checkIsPromLabelProxyEnabled + type: function label: Key loader: fetchInitialObjStorageTlsKey schema: temp/properties/objStorage/tlsKey - validation: - type: required watcher: func: onEnabledFeaturesChange paths: diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 8fafeb322d..e2588e13bd 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -529,6 +529,11 @@ export const useFunc = (model) => { return enabledFeatures.includes(thanosOperator) || enabledFeatures.includes(promLabelProxy) } + function checkIsPromLabelProxyEnabled() { + const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] + return enabledFeatures.includes(promLabelProxy) + } + function fetchInitialObjStorageProvider() { const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} @@ -573,14 +578,14 @@ export const useFunc = (model) => { function fetchInitialObjStorageTlsSecretName() { const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} - const refs = promValues.clientCaCertificateRefs || [] - return refs[0]?.name || '' + const refs = promValues.clientCaCertificateRefs || {} + return refs.name || '' } function fetchInitialObjStorageTlsKey() { const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} - const refs = promValues.clientCaCertificateRefs || [] - return refs[0]?.key || '' + const refs = promValues.clientCaCertificateRefs || {} + return refs.key || '' } return { @@ -600,6 +605,7 @@ export const useFunc = (model) => { fetchMonitoringClusterOptions, onMonitoringClusterChange, checkIsThanosOrPromLabelProxyEnabled, + checkIsPromLabelProxyEnabled, fetchInitialObjStorageProvider, fetchInitialObjStorageBucket, fetchInitialObjStorageEndpoint, From 28c57e56a4919e147663eb96a61b182b2687347c Mon Sep 17 00:00:00 2001 From: rafi Date: Tue, 28 Apr 2026 14:37:44 +0600 Subject: [PATCH 08/11] Fix otel stack api Signed-off-by: rafi --- .../ui/functions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index e2588e13bd..17d9f47de2 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -246,7 +246,9 @@ export const useFunc = (model) => { const owner = storeGet('/route/params/user') const cluster = storeGet('/route/params/cluster') - const { data } = await axios.get(`/telemetry/${owner}/${cluster}/values/appscode-otel-stack`) + const { data } = await axios.get( + `/telemetry/${owner}/${monitoringClusterName}/values/appscode-otel-stack?targetClusterName=${cluster}`, + ) return data } From d7cf2b140ce71eb9f22d78dc7bf18d5749c13c39 Mon Sep 17 00:00:00 2001 From: rafi-ruetcse17 Date: Sun, 17 May 2026 16:05:12 +0600 Subject: [PATCH 09/11] Remove all the fields that renders on condition of prom_label_proxy and thanos_operator Signed-off-by: rafi-ruetcse17 --- .../ui/create-ui.yaml | 99 ------------ .../ui/functions.js | 141 +----------------- 2 files changed, 1 insertion(+), 239 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml index ab224b7229..9aae7255fd 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/create-ui.yaml @@ -32,105 +32,6 @@ step: - temp/properties/monitoringClusterName validation: type: required - - type: block-layout - if: - name: checkIsThanosOrPromLabelProxyEnabled - type: function - label: Object Storage Configuration - elements: - - type: select - label: Backend Provider - schema: temp/properties/objStorage/provider - init: - type: static - value: s3 - options: - - text: s3 - value: s3 - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/provider - - type: input - label: Bucket - loader: fetchInitialObjStorageBucket - schema: temp/properties/objStorage/bucket - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/bucket - - type: input - label: Endpoint - loader: fetchInitialObjStorageEndpoint - schema: temp/properties/objStorage/endpoint - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/endpoint - - type: input - label: Access Key - loader: fetchInitialObjStorageAccessKey - schema: temp/properties/objStorage/accessKey - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/accessKey - - type: input - label: Secret Key - loader: fetchInitialObjStorageSecretKey - schema: temp/properties/objStorage/secretKey - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/secretKey - - type: input - label: Region - loader: fetchInitialObjStorageRegion - schema: temp/properties/objStorage/region - validation: - type: required - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/region - - type: label-element - if: - name: checkIsPromLabelProxyEnabled - type: function - label: TLS Config (Client CA Certificate) - customClass: mt-16 font-semibold - - type: input - if: - name: checkIsPromLabelProxyEnabled - type: function - label: Secret Name - loader: fetchInitialObjStorageTlsSecretName - schema: temp/properties/objStorage/tlsSecretName - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/tlsSecretName - - type: input - if: - name: checkIsPromLabelProxyEnabled - type: function - label: Key - loader: fetchInitialObjStorageTlsKey - schema: temp/properties/objStorage/tlsKey - watcher: - func: onEnabledFeaturesChange - paths: - - temp/properties/objStorage/tlsKey id: opscenter-monitoring loader: setReleaseNameAndNamespaceAndInitializeValues type: single-step-form diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 17d9f47de2..0af4f92efa 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -9,13 +9,7 @@ export const useFunc = (model) => { setDiscriminatorValue('/enabledFeatures', []) setDiscriminatorValue('/isResourceLoaded', false) const appsCodeOtelStack = 'appscode-otel-stack' - const thanosOperator = 'thanos-operator' - const promLabelProxy = 'prom-label-proxy' - - const thanosOperatorResPath = 'helmToolkitFluxcdIoHelmRelease_thanos_operator' - const promLabelProxyResPath = 'helmToolkitFluxcdIoHelmRelease_prom_label_proxy' let resources = {} - let telemetryHostPromise = null // get specific feature details function getFeatureSetDetails() { @@ -256,7 +250,6 @@ export const useFunc = (model) => { const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] const monitoringClusterName = getValue(discriminator, '/monitoringClusterName') let monitoringClusterConfig = getValue(discriminator, '/monitoringClusterConfig') - const objStorage = getValue(discriminator, '/objStorage') const allFeatures = storeGet('/cluster/features/result') || [] @@ -295,65 +288,6 @@ export const useFunc = (model) => { } } - if (featureName === thanosOperator && objStorage) { - const endpoint = (objStorage.endpoint || '').replace(/^https?:\/\//, '') - mergedResourceValues = deepMergeValues(initialResourceValues, { - objStorage: { - provider: objStorage.provider || 's3', - bucket: objStorage.bucket || '', - endpoint: endpoint, - accessKey: objStorage.accessKey || '', - secretKey: objStorage.secretKey || '', - region: objStorage.region || '', - }, - }) - } - - if (featureName === promLabelProxy && objStorage) { - const owner = storeGet('/route/params/user') - const cluster = storeGet('/route/params/cluster') - if (!telemetryHostPromise) { - telemetryHostPromise = (async () => { - try { - const { data } = await axios.get(`/telemetry/${owner}/${cluster}/stack/host`) - return data || '' - } catch (e) { - window.console.error('Failed to fetch telemetry host', e) - return '' - } - })() - } - const telemetryHost = await telemetryHostPromise - - const tlsSecretName = (objStorage.tlsSecretName || '').trim() - const tlsKey = (objStorage.tlsKey || '').trim() - - mergedResourceValues = deepMergeValues(initialResourceValues, { - clickhouse: { - s3: { - provider: objStorage.provider || 's3', - bucket: objStorage.bucket || '', - endpoint: objStorage.endpoint || '', - accessKey: objStorage.accessKey || '', - secretKey: objStorage.secretKey || '', - region: objStorage.region || '', - }, - tls: - tlsSecretName && tlsKey - ? { - clientCaCertificateRefs: { - key: tlsKey, - name: tlsSecretName, - }, - } - : undefined, - }, - infra: { - host: telemetryHost, - }, - }) - } - commit('wizard/model$update', { path: `/resources/${resourceValuePath}`, value: { @@ -526,69 +460,6 @@ export const useFunc = (model) => { await onEnabledFeaturesChange() } - function checkIsThanosOrPromLabelProxyEnabled() { - const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] - return enabledFeatures.includes(thanosOperator) || enabledFeatures.includes(promLabelProxy) - } - - function checkIsPromLabelProxyEnabled() { - const enabledFeatures = getValue(discriminator, '/enabledFeatures') || [] - return enabledFeatures.includes(promLabelProxy) - } - - function fetchInitialObjStorageProvider() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.provider || thanosValues.provider || 's3' - } - - function fetchInitialObjStorageBucket() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.bucket || thanosValues.bucket || '' - } - - function fetchInitialObjStorageEndpoint() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.endpoint || thanosValues.endpoint || '' - } - - function fetchInitialObjStorageRegion() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.region || thanosValues.region || '' - } - - function fetchInitialObjStorageAccessKey() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.accessKey || thanosValues.accessKey || '' - } - - function fetchInitialObjStorageSecretKey() { - const thanosValues = resources[thanosOperatorResPath]?.spec?.values?.objStorage || {} - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.s3 || {} - - return promValues.secretKey || thanosValues.secretKey || '' - } - - function fetchInitialObjStorageTlsSecretName() { - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} - const refs = promValues.clientCaCertificateRefs || {} - return refs.name || '' - } - - function fetchInitialObjStorageTlsKey() { - const promValues = resources[promLabelProxyResPath]?.spec?.values?.clickhouse?.tls || {} - const refs = promValues.clientCaCertificateRefs || {} - return refs.key || '' - } return { hideThisElement, @@ -605,16 +476,6 @@ export const useFunc = (model) => { fetchFeatureSetOptions, checkIsOtelStackEnabled, fetchMonitoringClusterOptions, - onMonitoringClusterChange, - checkIsThanosOrPromLabelProxyEnabled, - checkIsPromLabelProxyEnabled, - fetchInitialObjStorageProvider, - fetchInitialObjStorageBucket, - fetchInitialObjStorageEndpoint, - fetchInitialObjStorageRegion, - fetchInitialObjStorageAccessKey, - fetchInitialObjStorageSecretKey, - fetchInitialObjStorageTlsSecretName, - fetchInitialObjStorageTlsKey, + onMonitoringClusterChange } } From fcd2036e3aeeb7d4cfae6c6bc3cad5c80d98bec7 Mon Sep 17 00:00:00 2001 From: rafi Date: Thu, 21 May 2026 18:35:53 +0600 Subject: [PATCH 10/11] Add targetClusterName in montitoring-cluster api Signed-off-by: rafi --- .../ui/functions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 0af4f92efa..2312750808 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -442,7 +442,8 @@ export const useFunc = (model) => { } const owner = storeGet('/route/params/user') - let url = `/telemetry/${owner}/monitoring-clusters` + const cluster = storeGet('/route/params/cluster') + let url = `/telemetry/${owner}/monitoring-clusters?targetClusterName=${cluster}` const { data } = await axios.get(url) return data || [] From 1d3edb9b4758cf924470435c09486f60aedc827c Mon Sep 17 00:00:00 2001 From: rafi-ruetcse17 Date: Fri, 22 May 2026 23:32:02 +0600 Subject: [PATCH 11/11] Fix targetClusterName for spoke cluster Signed-off-by: rafi-ruetcse17 --- .../ui/functions.js | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js index 2312750808..a82b69fb88 100644 --- a/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js +++ b/charts/uik8sappscodecom-featureset-opscenter-observability-editor/ui/functions.js @@ -238,11 +238,19 @@ export const useFunc = (model) => { return null } + const getRoute = storeGet('/route') + const spokeCluster = getRoute.params?.spoke const owner = storeGet('/route/params/user') const cluster = storeGet('/route/params/cluster') - const { data } = await axios.get( - `/telemetry/${owner}/${monitoringClusterName}/values/appscode-otel-stack?targetClusterName=${cluster}`, - ) + let url = `/telemetry/${owner}/${monitoringClusterName}/values/appscode-otel-stack` + if (cluster) { + if (getRoute.fullPath.includes('/hubs/') && spokeCluster) { + url += `?targetClusterName=${encodeURIComponent(spokeCluster)}` + } else { + url += `?targetClusterName=${encodeURIComponent(cluster)}` + } + } + const { data } = await axios.get(url) return data } @@ -441,9 +449,18 @@ export const useFunc = (model) => { return [] } + const getRoute = storeGet('/route') + const spokeCluster = getRoute.params?.spoke const owner = storeGet('/route/params/user') const cluster = storeGet('/route/params/cluster') - let url = `/telemetry/${owner}/monitoring-clusters?targetClusterName=${cluster}` + let url = `/telemetry/${owner}/monitoring-clusters` + if (cluster) { + if (getRoute.fullPath.includes('/hubs/') && spokeCluster) { + url += `?targetClusterName=${encodeURIComponent(spokeCluster)}` + } else { + url += `?targetClusterName=${encodeURIComponent(cluster)}` + } + } const { data } = await axios.get(url) return data || [] @@ -461,7 +478,6 @@ export const useFunc = (model) => { await onEnabledFeaturesChange() } - return { hideThisElement, checkIsResourceLoaded, @@ -477,6 +493,6 @@ export const useFunc = (model) => { fetchFeatureSetOptions, checkIsOtelStackEnabled, fetchMonitoringClusterOptions, - onMonitoringClusterChange + onMonitoringClusterChange, } }