@@ -9,13 +9,7 @@ export const useFunc = (model) => {
99 setDiscriminatorValue ( '/enabledFeatures' , [ ] )
1010 setDiscriminatorValue ( '/isResourceLoaded' , false )
1111 const appsCodeOtelStack = 'appscode-otel-stack'
12- const thanosOperator = 'thanos-operator'
13- const promLabelProxy = 'prom-label-proxy'
14-
15- const thanosOperatorResPath = 'helmToolkitFluxcdIoHelmRelease_thanos_operator'
16- const promLabelProxyResPath = 'helmToolkitFluxcdIoHelmRelease_prom_label_proxy'
1712 let resources = { }
18- let telemetryHostPromise = null
1913
2014 // get specific feature details
2115 function getFeatureSetDetails ( ) {
@@ -256,7 +250,6 @@ export const useFunc = (model) => {
256250 const enabledFeatures = getValue ( discriminator , '/enabledFeatures' ) || [ ]
257251 const monitoringClusterName = getValue ( discriminator , '/monitoringClusterName' )
258252 let monitoringClusterConfig = getValue ( discriminator , '/monitoringClusterConfig' )
259- const objStorage = getValue ( discriminator , '/objStorage' )
260253
261254 const allFeatures = storeGet ( '/cluster/features/result' ) || [ ]
262255
@@ -295,65 +288,6 @@ export const useFunc = (model) => {
295288 }
296289 }
297290
298- if ( featureName === thanosOperator && objStorage ) {
299- const endpoint = ( objStorage . endpoint || '' ) . replace ( / ^ h t t p s ? : \/ \/ / , '' )
300- mergedResourceValues = deepMergeValues ( initialResourceValues , {
301- objStorage : {
302- provider : objStorage . provider || 's3' ,
303- bucket : objStorage . bucket || '' ,
304- endpoint : endpoint ,
305- accessKey : objStorage . accessKey || '' ,
306- secretKey : objStorage . secretKey || '' ,
307- region : objStorage . region || '' ,
308- } ,
309- } )
310- }
311-
312- if ( featureName === promLabelProxy && objStorage ) {
313- const owner = storeGet ( '/route/params/user' )
314- const cluster = storeGet ( '/route/params/cluster' )
315- if ( ! telemetryHostPromise ) {
316- telemetryHostPromise = ( async ( ) => {
317- try {
318- const { data } = await axios . get ( `/telemetry/${ owner } /${ cluster } /stack/host` )
319- return data || ''
320- } catch ( e ) {
321- window . console . error ( 'Failed to fetch telemetry host' , e )
322- return ''
323- }
324- } ) ( )
325- }
326- const telemetryHost = await telemetryHostPromise
327-
328- const tlsSecretName = ( objStorage . tlsSecretName || '' ) . trim ( )
329- const tlsKey = ( objStorage . tlsKey || '' ) . trim ( )
330-
331- mergedResourceValues = deepMergeValues ( initialResourceValues , {
332- clickhouse : {
333- s3 : {
334- provider : objStorage . provider || 's3' ,
335- bucket : objStorage . bucket || '' ,
336- endpoint : objStorage . endpoint || '' ,
337- accessKey : objStorage . accessKey || '' ,
338- secretKey : objStorage . secretKey || '' ,
339- region : objStorage . region || '' ,
340- } ,
341- tls :
342- tlsSecretName && tlsKey
343- ? {
344- clientCaCertificateRefs : {
345- key : tlsKey ,
346- name : tlsSecretName ,
347- } ,
348- }
349- : undefined ,
350- } ,
351- infra : {
352- host : telemetryHost ,
353- } ,
354- } )
355- }
356-
357291 commit ( 'wizard/model$update' , {
358292 path : `/resources/${ resourceValuePath } ` ,
359293 value : {
@@ -526,69 +460,6 @@ export const useFunc = (model) => {
526460 await onEnabledFeaturesChange ( )
527461 }
528462
529- function checkIsThanosOrPromLabelProxyEnabled ( ) {
530- const enabledFeatures = getValue ( discriminator , '/enabledFeatures' ) || [ ]
531- return enabledFeatures . includes ( thanosOperator ) || enabledFeatures . includes ( promLabelProxy )
532- }
533-
534- function checkIsPromLabelProxyEnabled ( ) {
535- const enabledFeatures = getValue ( discriminator , '/enabledFeatures' ) || [ ]
536- return enabledFeatures . includes ( promLabelProxy )
537- }
538-
539- function fetchInitialObjStorageProvider ( ) {
540- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
541- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
542-
543- return promValues . provider || thanosValues . provider || 's3'
544- }
545-
546- function fetchInitialObjStorageBucket ( ) {
547- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
548- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
549-
550- return promValues . bucket || thanosValues . bucket || ''
551- }
552-
553- function fetchInitialObjStorageEndpoint ( ) {
554- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
555- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
556-
557- return promValues . endpoint || thanosValues . endpoint || ''
558- }
559-
560- function fetchInitialObjStorageRegion ( ) {
561- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
562- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
563-
564- return promValues . region || thanosValues . region || ''
565- }
566-
567- function fetchInitialObjStorageAccessKey ( ) {
568- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
569- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
570-
571- return promValues . accessKey || thanosValues . accessKey || ''
572- }
573-
574- function fetchInitialObjStorageSecretKey ( ) {
575- const thanosValues = resources [ thanosOperatorResPath ] ?. spec ?. values ?. objStorage || { }
576- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. s3 || { }
577-
578- return promValues . secretKey || thanosValues . secretKey || ''
579- }
580-
581- function fetchInitialObjStorageTlsSecretName ( ) {
582- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. tls || { }
583- const refs = promValues . clientCaCertificateRefs || { }
584- return refs . name || ''
585- }
586-
587- function fetchInitialObjStorageTlsKey ( ) {
588- const promValues = resources [ promLabelProxyResPath ] ?. spec ?. values ?. clickhouse ?. tls || { }
589- const refs = promValues . clientCaCertificateRefs || { }
590- return refs . key || ''
591- }
592463
593464 return {
594465 hideThisElement,
@@ -605,16 +476,6 @@ export const useFunc = (model) => {
605476 fetchFeatureSetOptions,
606477 checkIsOtelStackEnabled,
607478 fetchMonitoringClusterOptions,
608- onMonitoringClusterChange,
609- checkIsThanosOrPromLabelProxyEnabled,
610- checkIsPromLabelProxyEnabled,
611- fetchInitialObjStorageProvider,
612- fetchInitialObjStorageBucket,
613- fetchInitialObjStorageEndpoint,
614- fetchInitialObjStorageRegion,
615- fetchInitialObjStorageAccessKey,
616- fetchInitialObjStorageSecretKey,
617- fetchInitialObjStorageTlsSecretName,
618- fetchInitialObjStorageTlsKey,
479+ onMonitoringClusterChange
619480 }
620481}
0 commit comments