Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing default scrapeInterval and evaluationInterval #4560

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

troytop
Copy link

@troytop troytop commented May 24, 2024

What this PR does / why we need it

If you pass the default values.yaml to helm install without these two keys set, the secret in prometheus-prometheus-kube-prometheus-prometheus 馃槥 is set to an empty string, which is invalid and causes it to fail to start.

If you pass the default values.yaml to helm install without these two keys set, the secret in prometheus-prometheus-kube-prometheus-prometheus 馃槥  is set to an empty string, which is invalid and causes it to fail to start.

Signed-off-by: Troy Topnik <troy.topnik@suse.com>
@jkroepke
Copy link
Member

dont get this.

{{- if .Values.prometheus.prometheusSpec.scrapeInterval }}
  scrapeInterval: {{ .Values.prometheus.prometheusSpec.scrapeInterval }}
{{- end }}

scrapeInterval is covered by an if condition. If scrapeInterval is empty, the if condition is false and the block is skipped

@troytop
Copy link
Author

troytop commented May 24, 2024

Perhaps this is only an issue when the user takes the chart's values.yaml and edits it for use as their values file. In that case scrapeInterval and evaluationInterval are explicitly set to an empty string. This scenario happens in the default Helm install workflow in the Rancher UI, but it might be an edge case for normal helm usage.

@jkroepke
Copy link
Member

Empty string is false, too.

If and default share the same
logic. There is no known condition where the if return true, but the default filter returns the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants