fix(helm): fix imagePullSecrets for statefulset-results-cache
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
- [x] Reviewed the
CONTRIBUTING.mdguide (required) - [ ] Documentation added
- [ ] Tests updated
- [x] 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,
featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
-
Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such,
- [ ] Changes that require user attention or interaction to upgrade are documented in
docs/sources/setup/upgrade/_index.md - [x] For Helm chart changes bump the Helm chart version in
production/helm/loki/Chart.yamland updateproduction/helm/loki/CHANGELOG.mdandproduction/helm/loki/README.md. Example PR - [ ] If the change is deprecating or removing a configuration option, update the
deprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR
+1
@Haibread hey thanks for your contribution :heart:
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 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
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