-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add scope configuration check. #6864
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions 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/test-infra repository. I understand the commands that are listed here. |
Welcome @maikelvl! |
Hi @maikelvl. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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/test-infra repository. |
I've signed the CLA |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/remove-lifecycle stale
{{- if and .Values.rbac.create (not .Values.rbac.scope) -}} | ||
{{- if .Values.rbac.create }} | ||
|
||
{{- if and .Values.rbac.scope (not .Values.controller.scope.enabled) -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the0 eq
function directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tao12345666333 Because this validation error should only trigger when rbac.scope=true
and controller.scope.enabled=false
.
Using eq
would also trigger the validation error if rbac.scope=false
and controller.scope.enabled=true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary for us to keep them unequal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't quite understand your question. 🤔 The valid values of these variables could be found in the description above.
The controller.scope.enabled
value is also used in the controller pod where --watch-namespace
is added. If controller.scope.enabled=false
and rbac.scope=true
this causes issues in Kubernetes runtime and this check prevents this misconfiguration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, if we use the same configuration item to control them, is it more direct?
In other words, no longer distinguish between controller.scope.enabled
and rbac.scope
, but use the configuration of global.scope
for control. WDYH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put it forward.
/area helm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maikelvl, rikatz, tao12345666333 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
A specific configuration of scope variables result in errors in runtime.
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=true \
--set=rbac.scope=true
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=false \
--set=rbac.scope=false
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=true \
--set=rbac.scope=false
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=false \
--set=rbac.scope=true
Reproduction
results in runtime in
By checking these config incompatibility during rendering the chart we can catch this early on.
Types of changes
How Has This Been Tested?
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=true \
--set=rbac.scope=true
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=false \
--set=rbac.scope=false
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=true \
--set=rbac.scope=false
helm template charts/ingress-nginx \
--output-dir=_manifests \
--set=controller.scope.enabled=false \
--set=rbac.scope=true
Checklist:
My change requires a change to the documentation.I have updated the documentation accordingly.I have added tests to cover my changes.new andexisting tests passed.