mastodon / chart

Helm chart for Mastodon deployment in Kubernetes
GNU Affero General Public License v3.0
161 stars 93 forks source link

fix: add missing bitnami common chart #60

Closed paolomainardi closed 7 months ago

paolomainardi commented 1 year ago

This is needed because there are many references to bitnami common chart features, like here: https://github.com/mastodon/chart/blob/main/templates/_helpers.tpl#L99

{{/*
Get the mastodon secret.
*/}}
{{- define "mastodon.secretName" -}}
{{- if .Values.mastodon.secrets.existingSecret }}
    {{- printf "%s" (tpl .Values.mastodon.secrets.existingSecret $) -}}
{{- else -}}
    {{- printf "%s" (include "common.names.fullname" .) -}}
{{- end -}}
{{- end -}}

It works now as an effect of a transitive dependency coming from external charts if everything is powered off (Redis, Postgresql and Elastic) then it fails.

SISheogorath commented 1 year ago

I think we should rather drop the usage of common.name.fullname instead of adding common, since the relevant references want to use the secret from the mastodon helm chart, which doesn't use common.names.fullname for its own name:

https://github.com/mastodon/chart/blob/94ffdc8f83307460106845db0fbd5e58fb7d4f5c/templates/secrets.yaml#L5

paolomainardi commented 1 year ago

@SISheogorath thanks, you're right, changed.

jeremiahlee commented 1 year ago

(To help with search engine results) This pull request needs to be merged because without it, people using the Helm chart who have their own PostgreSQL, Redis, and Elasticsearch resources will get this error:

Error: template: mastodon/templates/secret-smtp.yaml:5:29: executing "mastodon/templates/secret-smtp.yaml" at <include "common.names.fullname" .>: error calling include: template: no template "common.names.fullname" associated with template "gotpl"

Could you please review this @renchap?

jeremiahlee commented 1 year ago

@paolomainardi Looks like there are a few more places common.names.fullname needs to be replaced:

Postgres: https://github.com/mastodon/chart/blob/main/templates/_helpers.tpl#L123C31-L123C52

secret-smtp: https://github.com/mastodon/chart/blob/main/templates/secret-smtp.yaml#L5

paolomainardi commented 1 year ago

@jeremiahlee i'll work on this soon, i'll keep you posted.