Skip to content

To default helm-vault installation to vault enterprise when license is provided - #1202

Open
harshit-nema wants to merge 16 commits into
mainfrom
VAULT-45655-vault-helm-default-to-vaultEnt
Open

harshit-nema wants to merge 16 commits into
mainfrom
VAULT-45655-vault-helm-default-to-vaultEnt

Conversation

@harshit-nema

@harshit-nema harshit-nema commented Aug 6, 2026

Copy link
Copy Markdown

ISSUE :
The chart already wired the licence volume, mount, and VAULT_LICENSE_PATH env var when server.enterpriseLicense.secretName was set — but still served the Community Edition image, forcing Enterprise customers to manually override server.image.repository and server.image.tag.

SOLUTION :
Added vault.isEnterprise as a single source of truth for the license check, and two generic helpers — vault.resolveImageRepository and vault.resolveImageTag — containing the shared resolution logic. Six thin wrapper helpers delegate to these for the server, injector agent, and CSI agent respectively.

Resolution rules:

  • repository: if unset or hashicorp/vault (the default) → auto-select hashicorp/vault-enterprise (license) or hashicorp/vault (no license). Any other explicit repo is returned verbatim.
  • tag: if empty → auto-select AppVersion-ent (license) or AppVersion (no license). Any explicit tag is always returned verbatim — never mutated.

Image render sites in server-statefulset.yaml, injector-deployment.yaml, and csi-daemonset.yaml were updated to use these helpers. Empty tags now fall back to Chart.AppVersion instead of latest, making CE installs reproducible by default.

server.enterpriseLicense.secretName is the only configuration needed — no manual image overrides required for any component.

IMPLEMENTATION VERIFICATION :

  • helm-vault ent installation
    helm install vault . --set server.enterpriseLicense.secretName=vault-ent-license
image
  • helm-vault community edition installation
    helm install vault .
image

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@harshit-nema harshit-nema changed the title To default vault helm installation to vault enterprise when license is provided To default helm-vault installation to vault enterprise when license is provided Aug 6, 2026
@harshit-nema
harshit-nema marked this pull request as ready for review August 10, 2026 17:35
@harshit-nema
harshit-nema requested review from a team as code owners August 10, 2026 17:35
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Otherwise return the tag as-is.
*/}}
{{- define "vault.imageTag" -}}
{{- $tag := .Values.server.image.tag | default "latest" -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag will never be nil as it have a default value from the values.yaml file.
Also having default as latest seems contradicting to the default value in the vaules.yaml file.
Or we can have | default $.Chart.AppVersion and remove all the tag attributes from the values file so we can centrally control the vault version in one place(Chart.yaml)
We can discuss this with the team about this.

Suggested change
{{- $tag := .Values.server.image.tag | default "latest" -}}
{{- $tag := .Values.server.image.tag -}}

Comment thread templates/_helpers.tpl Outdated
If the tag already carries the suffix it is left unchanged (idempotent).
*/}}
{{- define "vault.agentImageTag" -}}
{{- $tag := .Values.injector.agentImage.tag | default "latest" -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- $tag := .Values.injector.agentImage.tag | default "latest" -}}
{{- $tag := .Values.injector.agentImage.tag -}}

Comment thread templates/_helpers.tpl Outdated
If the tag already carries the "-ent" suffix it is left unchanged (idempotent).
*/}}
{{- define "vault.csiAgentImageTag" -}}
{{- $tag := .Values.csi.agent.image.tag | default "latest" -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{- $tag := .Values.csi.agent.image.tag | default "latest" -}}
{{- $tag := .Values.csi.agent.image.tag -}}

Comment thread values.yaml
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
Comment thread templates/_helpers.tpl Outdated
*/}}
{{- define "vault.imageTag" -}}
{{- $tag := .Values.server.image.tag | default .Chart.AppVersion -}}
{{- if and .Values.server.enterpriseLicense.secretName .Values.server.enterpriseLicense.secretKey -}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is repeated many times. Could we extract this into another template and re-use that?

--ref main \
-f SOURCE_TAG="${{ github.ref_name }}" \
-f SOURCE_REPO="${{ github.repository }}"
- uses: hashicorp/actions-slack-status@v2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are already there in the main. Why is this showing up in this PR ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebased the branch. This change is gone now.

@harshit-nema
harshit-nema force-pushed the VAULT-45655-vault-helm-default-to-vaultEnt branch from 43adb45 to eeb59d5 Compare September 9, 2026 07:11
Comment thread templates/_helpers.tpl Outdated
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.

3 participants