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

fix(helm): fix imagePullSecrets for statefulset-results-cache #13051

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

Haibread
Copy link
Contributor

What this PR does / why we need it:

If you set the imagePullSecrets value, you will encounter an error as helm cannot template the statefulset-results-cache.yaml file :

helm template loki grafana/loki --version 6.6.1 --set-json imagePullSecrets='["test"]' --set loki.useTestSchema=true --set loki.storage.bucketNames.chunks=chunks

Error: template: loki/templates/results-cache/statefulset-results-cache.yaml:1:4: executing "loki/templates/results-cache/statefulset-results-cache.yaml" at <include "loki.memcached.statefulSet" (dict "ctx" $ "valuesSection" "resultsCache" "component" "results-cache")>: error calling include: template: loki/templates/memcached/_memcached-statefulset.tpl:75:17: executing "loki.memcached.statefulSet" at <$.ctx.Values.image.pullSecrets>: nil pointer evaluating interface {}.pullSecrets

This PR fixes this issue, which appears to be caused by a typo between $.ctx.Values.imagePullSecrets and $.ctx.Values.image.pullSecrets to match the values.yaml file

Which issue(s) this PR fixes:
Fixes #12632

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@Haibread Haibread requested a review from a team as a code owner May 28, 2024 16:31
@CLAassistant
Copy link

CLAassistant commented May 28, 2024

CLA assistant check
All committers have signed the CLA.

@HujinoKun
Copy link

+1

@DylanGuedes
Copy link
Contributor

@Haibread hey thanks for your contribution ❤️

sorry for the delay; do you mind resolving the conflicts? if you don't have the time this week, I can fix them, just let me know.

@Haibread
Copy link
Contributor Author

@Haibread hey thanks for your contribution ❤️

sorry for the delay; do you mind resolving the conflicts? if you don't have the time this week, I can fix them, just let me know.

Should be good to go, let me know if I need to edit anything

@DylanGuedes DylanGuedes merged commit 8434b2f into grafana:main Jul 23, 2024
63 checks passed
@sebhoss
Copy link
Contributor

sebhoss commented Jul 24, 2024

This change broke the entire chart? Before we had this in our values.yaml:

image:
  pullSecrets:
    - harbor-infra-run-pull-secret
imagePullSecrets:
  - name: harbor-infra-run-pull-secret

It was strange to specify pull secrets twice in two different formats, but worked for all workloads included in the loki helm chart. With this change, we now can just do

imagePullSecrets:
  - harbor-infra-run-pull-secret

which is nice and works for the cache statefulsets but breaks loki-gateway, loki-read, loki-backend, and loki-write deployments as they are not automtically adding the name: prefix before a pull secret, e.g. see https://github.com/grafana/loki/blob/main/production/helm/loki/templates/read/statefulset-read.yaml#L74-L76

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

Successfully merging this pull request may close these issues.

ImagePullSecret for loki memcached with error
5 participants