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

Cleanup to reduce Helm chart noise #825

Closed
wants to merge 1 commit into from
Closed

Conversation

ksa-real
Copy link
Contributor

@ksa-real ksa-real commented Nov 10, 2022

  • Multiple '---' and new lines could be previously produced by secrets.yaml
  • Some duplication removed from _env.tpl
  • telegram.webhookUrl defaults to base_url

Which issue(s) this PR fixes:

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated

@CLAassistant
Copy link

CLAassistant commented Nov 10, 2022

CLA assistant check
All committers have signed the CLA.

@ksa-real
Copy link
Contributor Author

This doesn't include items in the checklist. Please review the changes first and if it is fine with you, I'll add the rest.

@ksa-real
Copy link
Contributor Author

ksa-real commented Nov 27, 2022

This original issue has been fixed by another commit. Not that my approach was to define a snippet:

{{/* Single env variable. Context: list of var_name: string, value: <map or other> */}}
{{- define "snippet.env" -}}
- name: {{ first . }}
{{- $value := index . 1 }}
{{- if kindIs "map" $value }}
  {{- $value | toYaml | nindent 2 }}
{{- else }}
  value: {{ $value | quote }}
{{- end }}
{{- end }}

And then define an environmental variable like this:

{{ include "snippet.env" (list "SLACK_CLIENT_OAUTH_ID" (default "" .Values.oncall.slack.clientId)) }}

This way a user is pretty flexible in defining a source of data for env var in values.yaml: it can be string or a reference to a config map or a secret.

I don't think it make sense to continue with my PR anymore. Feel free to copy the snippets from this comment if needed later.

@ksa-real ksa-real force-pushed the secrets branch 2 times, most recently from 0bede2b to 8a14305 Compare November 27, 2022 04:46
@ksa-real ksa-real changed the title More control on env variables Cleanup to reduce Helm chart noise Nov 27, 2022
@ksa-real
Copy link
Contributor Author

I left just the cleanup part in my PR

- Multiple '---' and new lines could be previously produced by secrets.yaml
- Some duplication removed from _env.tpl
- telegram.webhookUrl defaults to base_url
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.

2 participants