The chart-managed init containers were hardcoded inside `deployment.yaml`. Their image, environment, resources, security context and volume mounts could not be adjusted individually, and custom init containers could only be prepended or appended as a whole via `preExtraInitContainers`/`postExtraInitContainers`. The init containers are now rendered from `deployment.initContainers`, an ordered list whose entries either `link` a chart-managed init container (`initDirectories`, `initAppIni`, `initConfigureGPG`, `initConfigureGitea`) or provide a free-form `container` definition. This allows custom containers at any position and makes the execution order explicit. Each linked init container has its own configuration block in `values.yaml` and falls back to `deployment.gitea.securityContext` and `initContainers.resources` when unset. To support per-container images, `gitea.image` was split into the generic helper `gitea.image.name`, which renders an arbitrary `image` dict instead of only `deployment.gitea.image`. The pod annotations moved from `deployment.yaml` into the new helper `gitea.pod.annotations`. The SHA sum annotations now also cover user-provided Secrets: their content is unknown to the chart, so the Secret is read from the cluster via Helm's `lookup` function. Chart-managed Secrets keep using the rendered manifest, because the cluster still holds their pre-upgrade state during rendering. Because `lookup` requires `get` permission on Secrets and silently returns nothing during client-side rendering (`helm template`, `--dry-run`, Argo CD without a live cluster), `addSHASumAnnotation` now defaults to `false`. The trade-offs are documented in the README so users can make an informed decision. BREAKING CHANGE: `preExtraInitContainers` and `postExtraInitContainers` have been removed. Add an entry with a `container` key before or after the linked init containers in `deployment.initContainers` instead. BREAKING CHANGE: `secrets.<secret>.addSHASumAnnotation` now defaults to `false`. Set it to `true` explicitly to keep the rollout trigger on Secret changes. Co-authored-by: Copilot <copilot@github.com>
52 lines
1.7 KiB
Smarty
52 lines
1.7 KiB
Smarty
---
|
|
|
|
{{/* annotations */}}
|
|
|
|
{{- define "gitea.pod.annotations" -}}
|
|
|
|
{{/* secret - admin */}}
|
|
{{- if and .Values.secrets.admin.enabled .Values.secrets.admin.addSHASumAnnotation }}
|
|
checksum/admin: {{ include "gitea.secret.checksum" (list . "admin") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - config */}}
|
|
{{- if and .Values.secrets.config.enabled .Values.secrets.config.addSHASumAnnotation }}
|
|
checksum/config: {{ include "gitea.secret.checksum" (list . "config") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - gpg */}}
|
|
{{- if and .Values.secrets.gpg.enabled .Values.secrets.gpg.addSHASumAnnotation }}
|
|
checksum/gpg: {{ include "gitea.secret.checksum" (list . "gpg") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - init */}}
|
|
{{- if and .Values.secrets.init.enabled .Values.secrets.init.addSHASumAnnotation }}
|
|
checksum/init: {{ include "gitea.secret.checksum" (list . "init") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - inlineConfig */}}
|
|
{{- if and .Values.secrets.inlineConfig.enabled .Values.secrets.inlineConfig.addSHASumAnnotation }}
|
|
checksum/inlineConfig: {{ include "gitea.secret.checksum" (list . "inlineConfig") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - metrics */}}
|
|
{{- if and .Values.secrets.metrics.enabled .Values.secrets.metrics.addSHASumAnnotation }}
|
|
checksum/metrics: {{ include "gitea.secret.checksum" (list . "metrics") }}
|
|
{{- end }}
|
|
|
|
{{/* secret - ldap */}}
|
|
{{- range $idx, $value := .Values.gitea.ldap }}
|
|
checksum/ldap_{{ $idx }}: {{ include "gitea.ldap_settings" (list $idx $value) | sha256sum }}
|
|
{{- end }}
|
|
|
|
{{/* secret - oauth */}}
|
|
{{- range $idx, $value := .Values.gitea.oauth }}
|
|
checksum/oauth_{{ $idx }}: {{ include "gitea.oauth_settings" (list $idx $value) | sha256sum }}
|
|
{{- end }}
|
|
|
|
{{/* custom pod annotations */}}
|
|
{{- with .Values.gitea.podAnnotations }}
|
|
{{ toYaml . }}
|
|
{{- end }}
|
|
|
|
{{- end }} |