Skip to content

VAULT-48125-Fix: omit spec.namespace from VaultAuth when not configured - #1319

Open
catamtz wants to merge 2 commits into
mainfrom
VAULT-48125
Open

VAULT-48125-Fix: omit spec.namespace from VaultAuth when not configured#1319
catamtz wants to merge 2 commits into
mainfrom
VAULT-48125

Conversation

@catamtz

@catamtz catamtz commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Helm chart always rendered spec.namespace in the VaultAuth resources it
creates, even when no Vault namespace was configured. The default value in
values.yaml is an empty string (""), so Helm emitted a bare namespace: key
with no value. When applied via server-side apply, Kubernetes deserialises this as
null, which fails the CRD schema validation:

Error: INSTALLATION FAILED: ... spec.namespace: Invalid value: "null":
spec.namespace in body must be of type string: "null"

This blocked any install of VSO where Vault namespaces are not in use — the common
case for open-source Vault deployments.

Changes

chart/templates/default-vault-auth-method.yaml

chart/templates/default-transit-auth-method.yaml

Wrapped spec.namespace in a conditional so the key is omitted entirely when the
value is empty. This matches the pattern already used for allowedNamespaces and
other optional fields throughout the chart:

# before
spec:
  namespace: {{ .Values.defaultAuthMethod.namespace }}

after

spec:
  {{- if .Values.defaultAuthMethod.namespace }}
  namespace: {{ .Values.defaultAuthMethod.namespace }}
  {{- end }}

The same fix is applied to the transit auth method template, which had the identical
issue under the storageEncryption path (persistenceModel=direct-encrypted).

test/unit/default-vault-auth-method.bats
test/unit/default-transit-auth-method.bats

Added a regression test to each file asserting that spec.namespace is absent from
the rendered manifest when no namespace value is configured.

@catamtz catamtz added this to the v1.6.0 milestone Jul 27, 2026
@catamtz catamtz added bug Something isn't working reproduced This issue has been reproduced by a Vault engineer labels Jul 27, 2026
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jul 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@catamtz
catamtz marked this pull request as ready for review July 28, 2026 13:16
@catamtz
catamtz requested review from a team as code owners July 28, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working reproduced This issue has been reproduced by a Vault engineer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant