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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[azure-metrics-exporter]: fix broken servicemonitor.metricprobe.yaml #62

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

x418
Copy link
Contributor

@x418 x418 commented Sep 18, 2024

What this PR does / why we need it

This fixes the invalid condition (to check for namespaceSelector) that prevents template from rendering.

i.e. When probes exist, the template no longer renders as shown below

Error: template: azure-metrics-exporter/templates/prometheus/servicemonitor.metricprobe.yaml:23:16: executing "azure-metrics-exporter/templates/prometheus/servicemonitor.metricprobe.yaml" at <.Values.prometheus.monitor.namespaceSelector>: nil pointer evaluating interface {}.prometheus

Which issue this PR fixes

Special notes for your reviewer

Checklist

  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [azure-metrics-exporter])

…e.yaml

## What & Why?

This fixes the invalid condition (to check for namespaceSelector) caused by #56
@x418 x418 changed the title [charts/azure-metrics-exporter]: fix broken servicemonitor.metricprobes.yaml [charts/azure-metrics-exporter]: fix broken servicemonitor.metricprobe.yaml Sep 18, 2024
@x418 x418 changed the title [charts/azure-metrics-exporter]: fix broken servicemonitor.metricprobe.yaml [azure-metrics-exporter]: fix broken servicemonitor.metricprobe.yaml Sep 18, 2024
@ThomasMinor
Copy link

This PR also seems to fix #60

@ThomasMinor
Copy link

ThomasMinor commented Sep 30, 2024

Is there any date planned for his to get integrated?

@antonKirkPalark
Copy link

@mblaschke approve pls

{{- if .Values.prometheus.monitor.namespaceSelector }}
namespaceSelector: {{ toYaml .Values.prometheus.monitor.namespaceSelector | nindent 4 }}
{{- if $root.Values.prometheus.monitor.namespaceSelector }}
namespaceSelector: {{ toYaml $root.Values.prometheus.monitor.namespaceSelector | nindent 4 }}
{{- else }}
namespaceSelector:
matchNames:
- {{ template "azure-metrics-exporter.namespace" . }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $root instead of .

@mblaschke mblaschke merged commit c27f9b2 into webdevops:main Oct 31, 2024
mblaschke added a commit that referenced this pull request Oct 31, 2024
@x418 x418 deleted the fix-chart branch October 31, 2024 16:35
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.

4 participants