-
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
Print warning only instead of error if no permission on ingressclass #7578
Conversation
Hi @yongjie-gong. 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. |
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
/test pull-ingress-nginx-gofmt |
1 similar comment
/test pull-ingress-nginx-gofmt |
/assign Maybe canary error is valid, will look again |
if errors.IsUnauthorized(err) { | ||
klog.Fatalf("Error searching IngressClass: Please verify your RBAC and allow Ingress Controller to list and get Ingress Classes: %v", err) | ||
} else if errors.IsForbidden(err) { |
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.
What is the difference between unauthorized an forbidden?
When one can happen and other not?
After that clarification, 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.
@yongjie-gong friendly reminder
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.
So the difference here is code 401 (user not authenticated) vs 403 (user without permission to do that action).
We should rely on 403 always, but anyway seems like a good safeguard also to look into 401.
I'm going to merge this, but improve the logics on a follow up PR, leaving both 401 and 403 as situations to ignore IngressClass and adding some e2e tests for this.
@yongjie-gong I'm leaving this to v1.0.2 but we need to fix it ASAP :) Thanks! |
/priority important-soon |
/triage accepted |
/lgtm Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, yongjie-gong 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 |
…ubernetes#7578) * skip ingressclass check if ingressclass is not enabled * reformat with gofmt
…ter level resource IngressClass
What this PR does / why we need it:
for backaward compatibility, if serviceaccount who run the ingress-controller don't have permission on cluster level resource IngressClass, ingress-controller will fail directly. Add this PR to provide backaward compabitiltiy
Types of changes
Which issue/s this PR fixes
fixes #7510
#7510
How Has This Been Tested?
Compile new ingress-controller and start with serviceaccount who don't have Permission on IngressClass
Checklist: