Skip to content

fix(chart): gate namespace creation behind createNamespace value - #82

Open
stone wants to merge 2 commits into
mainfrom
fix/helm-create-namespace-conflict
Open

fix(chart): gate namespace creation behind createNamespace value#82
stone wants to merge 2 commits into
mainfrom
fix/helm-create-namespace-conflict

Conversation

@stone

@stone stone commented Aug 26, 2026

Copy link
Copy Markdown
Member
  • Namespace template now gated behind createNamespace value (default false)
  • Added helm.sh/resource-policy: keep annotation to preserve namespace on deletion
  • Fixes conflicts with helm install --create-namespace on both Helm 3 and 4

Fixes namespace deletion:

helm install -n varnish-gateway varnish/varnish-gateway --create-namespace 
kubectl -n varnish-gateway run keepme --image=busybox -- sleep 36000 
helm delete -n varnish-gateway varnish-gateway # <-- Also deletes the keepme pod

Also fixes adopting a namespace:

kubectl create namespace varnish-gateway-system
helm install varnish-gateway oci://ghcr.io/varnish/charts/varnish-gateway --namespace varnish-gateway-system # Fails

- Namespace template now gated behind createNamespace value (default false)
- Added helm.sh/resource-policy: keep annotation to preserve namespace on deletion
- Fixes conflicts with helm install --create-namespace on both Helm 3 and 4

Fixes namespace deletion:

  helm install -n varnish-gateway varnish/varnish-gateway --create-namespace
  kubectl -n varnish-gateway run keepme --image=busybox -- sleep 36000
  helm delete -n varnish-gateway varnish-gateway # <-- Also deletes the keepme pod

Also fixes adopting a namespace:

kubectl create namespace varnish-gateway-system
helm install varnish-gateway oci://ghcr.io/varnish/charts/varnish-gateway --namespace varnish-gateway-system # Fails
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.87%. Comparing base (ff7844c) to head (efd8af3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
- Coverage   71.99%   71.87%   -0.12%     
==========================================
  Files          41       41              
  Lines        6716     6716              
==========================================
- Hits         4835     4827       -8     
- Misses       1539     1545       +6     
- Partials      342      344       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Add test fixture exercising namespace creation
- Update values.schema.json with createNamespace
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.

1 participant