Skip to content

Commit c140083

Browse files
committed
Improve the wording around the opencost validation
Signed-off-by: Pete Wall <[email protected]>
1 parent 625ff0c commit c140083

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

charts/k8s-monitoring/templates/features/_feature_cluster_metrics.tpl

+3-5
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,14 @@ cluster_metrics "feature" {
167167
{{- end -}}
168168

169169
{{- if eq $destinationFound false }}
170-
{{- $msg := list "" (printf "%s is not a valid Prometheus data source for OpenCost.") }}
170+
{{- $msg := list "" (printf "The destination \"%s\" is not a Prometheus data source." $.Values.clusterMetrics.opencost.metricsSource) }}
171+
{{- $msg = append $msg "OpenCost requires a Prometheus database to query where cluster metrics are stored." }}
172+
{{- $msg = append $msg "" }}
171173
{{- $msg = append $msg "Please set:" }}
172174
{{- $msg = append $msg "clusterMetrics:" }}
173175
{{- $msg = append $msg " opencost:" }}
174-
{{- if eq (len $destinations) 1 }}
175-
{{- $msg = append $msg (printf " metricsSource: %s" (index $destinations 0)) }}
176-
{{- else }}
177176
{{- $msg = append $msg " metricsSource: <metrics destination name>" }}
178177
{{- $msg = append $msg (printf "Where <metrics destination name> is one of %s" (include "english_list_or" $destinations)) }}
179-
{{- end }}
180178
{{- fail (join "\n" $msg) }}
181179
{{- end -}}
182180
{{- end -}}

0 commit comments

Comments
 (0)