fix(chart): use leaderElection.namespace for leader election RBAC - #476
Conversation
Signed-off-by: Divyansh Rawat <divyanshrawatofficial@gmail.com>
✅ Deploy Preview for node-readiness-controller canceled.
|
|
Hi @DsThakurRawat. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ajaysundark, DsThakurRawat The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thanks for the fix! |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When
leaderElection.namespaceis overridden in values.yaml (for example tokube-system), the chart templated the leader election Role and RoleBinding into the default release namespace rather than honoring the overridden namespace. As a result, the controller could not acquire or renew leader election leases in the target namespace due to missing RBAC permissions.This PR updates
charts/node-readiness-controller/templates/rbac.yamlto:default (include "node-readiness-controller.namespace" .) .Values.leaderElection.namespacefor the Role and RoleBinding namespace.{{- if .Values.leaderElection.enabled }}, omitting them when leader election is disabled.charts/node-readiness-controller/tests/rbac_test.yamlverifying default release namespace behavior, namespace override behavior, and disabled leader election.Which issue(s) this PR fixes:
Fixes #473
Special notes for your reviewer:
Verified locally:
./hack/verify-all.shpassed (boilerplate, chart drift, links, govulncheck clean)make testpassed (controller 86.3%, webhook 82.4%)make lintpassed (0 issues)