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

[prometheus-stackdriver-exporter] fix deployment annotations #4767

Merged
merged 6 commits into from
Oct 8, 2024

Conversation

wsmolkowski
Copy link
Contributor

@wsmolkowski wsmolkowski commented Aug 2, 2024

What this PR does / why we need it

fix #4768

Which issue this PR fixes

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

Signed-off-by: Wojciech Smołkowski <wojciech.smolkowski@gmail.com>
Signed-off-by: Wojciech Smołkowski <wojciech.smolkowski@gmail.com>
@wsmolkowski wsmolkowski changed the title fix deployment annotations [prometheus-couchdb-exporter] fix deployment annotations Aug 2, 2024
@wsmolkowski wsmolkowski changed the title [prometheus-couchdb-exporter] fix deployment annotations [prometheus-stackdriver-exporter] fix deployment annotations Aug 2, 2024
rpahli
rpahli previously approved these changes Aug 6, 2024
@wsmolkowski
Copy link
Contributor Author

@rpahli when could you merge it?

@rpahli
Copy link
Member

rpahli commented Aug 26, 2024

@wsmolkowski there are still build error. Can you pls fix the build, then we can merge your PR.

@rpahli
Copy link
Member

rpahli commented Sep 13, 2024

@wsmolkowski any update on this? can you pls fix the lint error?

Signed-off-by: MH <zanhsieh@gmail.com>

Signed-off-by: MH <zanhsieh@gmail.com>
@rpahli rpahli merged commit 1e6b5cb into prometheus-community:main Oct 8, 2024
4 checks passed
@sboschman
Copy link

Seems chart version 4.6.1 is broken, b/c:

    {{- with .Values.annotations }}
    annotations:
      {{- toYaml .Values.annotations | indent 6 }}
    {{- end }}
Error: template: prometheus-stackdriver-exporter/charts/prometheus-stackdriver-exporter/templates/deployment.yaml:9:24: executing "prometheus-stackdriver-exporter/charts/prometheus-stackdriver-exporter/templates/deployment.yaml" at <.Values.annotations>: nil pointer evaluating interface {}.annotations

with changes the context if I am not mistaken, so the toYaml will fail. As .Values should come from the root context, e.g. $.Values.annotations inside the with or simply {{- toYaml . | indent 6 }} should work.

@bc-bishwash
Copy link

bc-bishwash commented Oct 8, 2024

This is causing errors, with default values file:

Error: Error: template: prometheus-stackdriver-exporter/templates/deployment.yaml:9:24: executing "prometheus-stackdriver-exporter/templates/deployment.yaml" at <.Values.annotations>: nil pointer evaluating interface {}.annotations

@@ -4,6 +4,10 @@ metadata:
name: {{ template "stackdriver-exporter.fullname" . }}
labels:
{{- include "stackdriver-exporter.labels" . | indent 4 }}
{{- with .Values.annotations }}

Choose a reason for hiding this comment

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

I'm not sure, but looks like you should use "{{- if .Values.annotations }}" to exclude error

  Error: template: prometheus-stackdriver-exporter/templates/deployment.yaml:9:24: executing "prometheus-stackdriver-exporter/templates/deployment.yaml" at <.Values.annotations>: nil pointer evaluating interface {}.annotations

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.

[prometheus-stackdriver-exporter] Deployment metadata missing annotations
6 participants