Skip to content

fix(helm): add configurable namespace override to chart templates - #484

Open
casinesque wants to merge 2 commits into
qdrant:mainfrom
casinesque:feature/namespace-override-from-chart
Open

fix(helm): add configurable namespace override to chart templates#484
casinesque wants to merge 2 commits into
qdrant:mainfrom
casinesque:feature/namespace-override-from-chart

Conversation

@casinesque

Copy link
Copy Markdown

What

Adds an explicit metadata.namespace to all chart templates, defaulting to
.Release.Namespace, and exposes a namespace value to override it.

Closes #432

Why

I thought this could be useful since some tools (e.g. GitOps controllers using
helm template under the hood) expect resources to declare namespace
explicitly rather than relying on the implicit release namespace.

Change

The fix was quite simple: added namespace: {{ .Values.namespace | default .Release.Namespace }}
to metadata in each template, and added a namespace: "" field in
values.yaml to allow overriding the default.

Testing

  • helm template . — renders identically to before (fallback to
    .Release.Namespace, no behavior change)
  • helm template . --set namespace=custom-ns — all resources render with
    namespace: custom-ns

Backwards compatibility

Non-breaking: default behavior is unchanged when namespace is not set.

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.

Namespace override

1 participant