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 namespace rendering in provisioner job #8449

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

trevorwhitney
Copy link
Collaborator

What this PR does / why we need it:

Fix rendering of namespace in provisioner job template when a secertNamespace is provided that's different from the release namespace.

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

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

@trevorwhitney trevorwhitney requested a review from a team as a code owner February 7, 2023 16:38
Copy link
Contributor

@MichelHollands MichelHollands left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -99,11 +99,12 @@ spec:
{{- end }}
{{- $namespace := $.Release.Namespace }}
{{- with .Values.monitoring.selfMonitoring.tenant }}
{{- $secretNamespace := tpl .secretNamespace $ }}
Copy link

@basvdl basvdl Feb 7, 2023

Choose a reason for hiding this comment

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

Maybe we need the same fix for line 96... But only if we expect the user to set a templated var i.e.

  provisioner:
    additionalTenants:
      - name: foo-bar
        secretNamespace: "{{ .Release.Namespace }}"

Will result in:

          kubectl --namespace "{{ .Release.Namespace }}" create secret generic "enterprise-logs-provisioned-foo-bar" \
            --from-literal=token-write="$(cat /bootstrap/token-write-foo-bar)" \
            --from-literal=token-read="$(cat /bootstrap/token-read-foo-bar)"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I would be surprised if a user wanted to set this to a templated value. let's wait for a specific request for that functionality before adding it.

@trevorwhitney trevorwhitney merged commit 8ed5dd8 into grafana:main Feb 7, 2023
mraboosk pushed a commit to mraboosk/loki that referenced this pull request Oct 7, 2024
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.

Helm: Container create-secret in job-provisioner is not completing successful
3 participants