diff --git a/README.md b/README.md index 7def29c..0c0cd0e 100644 --- a/README.md +++ b/README.md @@ -1301,7 +1301,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo | `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` | | `extraContainers` | Additional sidecar containers to run in the pod. | `[]` | | `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` | -| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Gitea main container. | `[]` | ### Init @@ -1512,6 +1511,12 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma field of the Ingress resource it populates. The chart fails to render if `ingress.className` is still set, even when it is set to an empty string. +- `extraVolumeMounts` has been removed. Deprecated since 6.0.0, it mounted the same volumes into the init containers + and into the Gitea container, and it was silently ignored as soon as `extraInitVolumeMounts` or + `deployment.gitea.volumeMounts` contained a single entry. Split the mounts explicitly: use `extraInitVolumeMounts` + for the init containers and `deployment.gitea.volumeMounts` for the Gitea container. Volumes that are needed in both + places have to be listed in both settings. +
diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 22d9873..28dd21a 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -476,20 +476,14 @@ https {{- end -}} {{- define "gitea.init-additional-mounts" -}} - {{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}} {{- if gt (len .Values.extraInitVolumeMounts) 0 -}} {{- toYaml .Values.extraInitVolumeMounts -}} - {{- else if gt (len .Values.extraVolumeMounts) 0 -}} - {{- toYaml .Values.extraVolumeMounts -}} {{- end -}} {{- end -}} {{- define "gitea.container-additional-mounts" -}} - {{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}} {{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}} {{- toYaml .Values.deployment.gitea.volumeMounts -}} - {{- else if gt (len .Values.extraVolumeMounts) 0 -}} - {{- toYaml .Values.extraVolumeMounts -}} {{- end -}} {{- end -}} diff --git a/templates/_initContainers.tpl b/templates/_initContainers.tpl index 0f90de0..a24e366 100644 --- a/templates/_initContainers.tpl +++ b/templates/_initContainers.tpl @@ -174,9 +174,7 @@ - name: gpg-private-key mountPath: /raw readOnly: true - {{- if .Values.extraVolumeMounts }} - {{- toYaml .Values.extraVolumeMounts | nindent 4 }} - {{- end }} + {{- include "gitea.init-additional-mounts" . | nindent 4 }} {{- with $config.volumeMounts }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/templates/deprecation.yaml b/templates/deprecation.yaml index 7cdd34f..83ce70d 100644 --- a/templates/deprecation.yaml +++ b/templates/deprecation.yaml @@ -65,6 +65,11 @@ {{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}} {{- end -}} + {{/* EXTRA VOLUME MOUNTS */}} + {{- if .Values.extraVolumeMounts -}} + {{- fail "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `extraInitVolumeMounts` instead." -}} + {{- end -}} + {{/* EXTRA VOLUMES */}} {{- if .Values.extraVolumes -}} {{- fail "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead." -}} diff --git a/unittests/helm/deployment/deprecations.yaml b/unittests/helm/deployment/deprecations.yaml index 137a3b2..635db56 100644 --- a/unittests/helm/deployment/deprecations.yaml +++ b/unittests/helm/deployment/deprecations.yaml @@ -54,6 +54,14 @@ tests: asserts: - failedTemplate: errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." + - it: fails when the removed `extraVolumeMounts` value is set + set: + extraVolumeMounts: + - name: postgres-ssl-vol + mountPath: /pg-ssl + asserts: + - failedTemplate: + errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `extraInitVolumeMounts` instead." - it: fails when the removed `extraVolumes` value is set set: extraVolumes: @@ -185,6 +193,9 @@ tests: extraContainerVolumeMounts: - name: postgres-ssl-vol mountPath: /pg-ssl + extraVolumeMounts: + - name: postgres-ssl-vol + mountPath: /pg-ssl extraVolumes: - name: postgres-ssl-vol secret: diff --git a/values.yaml b/values.yaml index ec12d54..528b7a9 100644 --- a/values.yaml +++ b/values.yaml @@ -926,13 +926,6 @@ extraContainers: [] ## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. extraInitVolumeMounts: [] - -## @deprecated The extraVolumeMounts variable has been split two: -## - deployment.gitea.volumeMounts -## - extraInitVolumeMounts -## As an example, can be used to mount a client cert when connecting to an external Postgres server. -## @param extraVolumeMounts **DEPRECATED** Additional volume mounts for init containers and the Gitea main container. -extraVolumeMounts: [] # - name: postgres-ssl-vol # readOnly: true # mountPath: "/pg-ssl"