Skip to content

fix: add missing namespace to static Helm templates#2593

Merged
sozercan merged 1 commit into
open-policy-agent:masterfrom
devoncrouse:fix-sa-namespace
Feb 21, 2023
Merged

fix: add missing namespace to static Helm templates#2593
sozercan merged 1 commit into
open-policy-agent:masterfrom
devoncrouse:fix-sa-namespace

Conversation

@devoncrouse
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
A few static templates for the Helm chart are missing a namespace when rendered using helm template, causing failure when applied this way with a non-default namespace:

helm template gatekeeper gatekeeper/gatekeeper -n kube-system | kubectl apply -f -
# Resources created in default namespace:
kubectl get jobs
NAME                                         COMPLETIONS   DURATION   AGE
gatekeeper-update-namespace-label            0/1           39s        39s

kubectl get serviceaccounts
NAME                                  SECRETS   AGE
gatekeeper-update-namespace-label     0         87s

# Reference to service account in chart namespace:
kubectl get clusterrolebinding gatekeeper-update-namespace-label -o yaml
...
subjects:
- kind: ServiceAccount
  name: gatekeeper-update-namespace-label
  namespace: kube-system

# Pod failure in wrong namespace
kubectl describe gatekeeper-update-namespace-label-zrld4
...
  Warning  FailedMount  102s                 kubelet            Unable to attach or mount volumes: unmounted volumes=[cert], unattached volumes=[cert kube-api-access-dnn7h]: timed out waiting for the condition
  Warning  FailedMount  97s (x9 over 3m45s)  kubelet            MountVolume.SetUp failed for volume "cert" : secret "gatekeeper-webhook-server-cert" not found

Signed-off-by: Devon Crouse <devon.crouse@oracle.com>
Copy link
Copy Markdown
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

LGTM

@maxsmythe maxsmythe requested a review from ritazh February 21, 2023 20:19
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.61%. Comparing base (0f2c8ea) to head (c169cfb).
Report is 672 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2593      +/-   ##
==========================================
+ Coverage   53.58%   53.61%   +0.02%     
==========================================
  Files         120      120              
  Lines       10634    10634              
==========================================
+ Hits         5698     5701       +3     
+ Misses       4502     4500       -2     
+ Partials      434      433       -1     
Flag Coverage Δ
unittests 53.61% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

@sozercan sozercan merged commit b027979 into open-policy-agent:master Feb 21, 2023
davis-haba pushed a commit to davis-haba/gatekeeper that referenced this pull request Mar 7, 2023
davis-haba pushed a commit to davis-haba/gatekeeper that referenced this pull request Mar 8, 2023
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.

4 participants