Skip to content

Add Helm template validation for mutually exclusive namespace flags#65

Merged
bdehamer merged 2 commits intobdehamer/helmfrom
copilot/sub-pr-62
Mar 20, 2026
Merged

Add Helm template validation for mutually exclusive namespace flags#65
bdehamer merged 2 commits intobdehamer/helmfrom
copilot/sub-pr-62

Conversation

Copy link

Copilot AI commented Mar 20, 2026

config.namespace and config.excludeNamespaces are mutually exclusive — the controller calls os.Exit(1) when both are set — but the chart previously rendered both args without complaint, producing a broken install.

Changes

  • templates/deployment.yaml: Adds a fail guard at the top of the template that aborts helm install/helm upgrade with a clear error when both values are non-empty:
{{- if and .Values.config.namespace .Values.config.excludeNamespaces }}
{{- fail "config.namespace and config.excludeNamespaces are mutually exclusive and cannot both be set" }}
{{- end }}

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI changed the title [WIP] [WIP] Address feedback on Helm chart for deployment-tracker implementation Add Helm template validation for mutually exclusive namespace flags Mar 20, 2026
Copilot AI requested a review from bdehamer March 20, 2026 20:38
@bdehamer bdehamer marked this pull request as ready for review March 20, 2026 20:46
@bdehamer bdehamer requested a review from a team as a code owner March 20, 2026 20:46
Copilot AI review requested due to automatic review settings March 20, 2026 20:46
@bdehamer bdehamer merged commit 3ed5e00 into bdehamer/helm Mar 20, 2026
6 checks passed
@bdehamer bdehamer deleted the copilot/sub-pr-62 branch March 20, 2026 20:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Helm-side validation to prevent generating an invalid controller Deployment when both config.namespace and config.excludeNamespaces are set, matching the controller’s runtime constraint.

Changes:

  • Add a Helm template fail guard to abort helm install/upgrade if config.namespace and config.excludeNamespaces are both non-empty.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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