Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing namespace to static Helm templates #2593

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

devoncrouse
Copy link
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
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

@codecov-commenter
Copy link

Codecov Report

Base: 53.58% // Head: 53.61% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (c169cfb) compared to base (0f2c8ea).
Patch has no changes to coverable lines.

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.

Impacted Files Coverage Δ
...onstrainttemplate/constrainttemplate_controller.go 59.09% <0.00%> (-0.96%) ⬇️
pkg/readiness/object_tracker.go 83.98% <0.00%> (+1.06%) ⬆️
pkg/readiness/list.go 91.17% <0.00%> (+11.76%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
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.

None yet

4 participants