Fix: support alternative formats in extraVolumes #1104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes the 'vault.volumes' helper compatible with more robust Helm syntax. Supports both
.type
-based and fullsecret
/configMap
object definitions. Backward-compatible.Pull Request Summary
This PR addresses an issue in the Helm chart rendering process where an invalid volume definition is generated when
.Values.server.extraVolumes
includes a secret without specifying atype
. The rendered template previously resulted in malformed YAML such as:This change updates the
vault.volumes
template logic to ensure a propertype
(eithersecret
orconfigMap
) is set before rendering, and skips or warns on unrecognized or undefined types. This improves compatibility and prevents invalid Kubernetes manifests.✅ Context of this PR
This patch improves the Helm template for Vault to allow a more modern and explicit way of defining custom volumes via
server.extraVolumes
.💡 Why this change?
The original template only supported this format:
However:
secretName
is missing),secret:
orconfigMap:
blocks are used).🔧 What this patch adds
The chart now also accepts the more explicit format below, while keeping backward compatibility with the old
type
-based definition:This change is fully backward-compatible.
📘 Full example
Which produces the following Helm output:
Let me know if you'd like this also documented in the official chart
README.md
— I can contribute that too.