github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/application/applications/metriccollection/helm.go (about) 1 package metriccollection 2 3 import ( 4 toolsetslatest "github.com/caos/orbos/internal/operator/boom/api/latest" 5 "github.com/caos/orbos/internal/operator/boom/application/applications/metriccollection/helm" 6 "github.com/caos/orbos/internal/operator/boom/templator/helm/chart" 7 "github.com/caos/orbos/internal/utils/helper" 8 "github.com/caos/orbos/mntr" 9 ) 10 11 func (p *PrometheusOperator) SpecToHelmValues(monitor mntr.Monitor, toolset *toolsetslatest.ToolsetSpec) interface{} { 12 // spec := toolset.PrometheusNodeExporter 13 imageTags := p.GetImageTags() 14 image := "quay.io/coreos/prometheus-operator" 15 16 if toolset != nil && toolset.MetricCollection != nil { 17 helper.OverwriteExistingValues(imageTags, map[string]string{ 18 image: toolset.MetricCollection.OverwriteVersion, 19 }) 20 helper.OverwriteExistingKey(imageTags, &image, toolset.MetricCollection.OverwriteImage) 21 } 22 values := helm.DefaultValues(imageTags, image) 23 24 // if spec.ReplicaCount != 0 { 25 // values.ReplicaCount = spec.ReplicaCount 26 // } 27 28 spec := toolset.MetricCollection 29 if spec == nil { 30 return values 31 } 32 33 if spec.NodeSelector != nil { 34 for k, v := range spec.NodeSelector { 35 values.PrometheusOperator.NodeSelector[k] = v 36 } 37 } 38 39 if spec.Tolerations != nil { 40 for _, tol := range spec.Tolerations { 41 values.PrometheusOperator.Tolerations = append(values.PrometheusOperator.Tolerations, tol) 42 } 43 } 44 45 if spec.Resources != nil { 46 values.PrometheusOperator.Resources = spec.Resources 47 } 48 49 return values 50 } 51 52 func (p *PrometheusOperator) GetChartInfo() *chart.Chart { 53 return helm.GetChartInfo() 54 } 55 56 func (p *PrometheusOperator) GetImageTags() map[string]string { 57 return helm.GetImageTags() 58 }