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
Handle two or more default IngressClasses more cleanly #110974
Handle two or more default IngressClasses more cleanly #110974
Conversation
@kidddddddddddddddddddddd: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @kidddddddddddddddddddddd. 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. |
plugin/pkg/admission/storage/storageclass/setdefault/admission.go
Outdated
Show resolved
Hide resolved
And fix the title of this PR? |
68f233f
to
2393e25
Compare
|
expectedClass: nil, | ||
expectedError: errors.NewForbidden(networkingv1.Resource("ingresses"), "testing", errors.NewInternalError(fmt.Errorf("2 default IngressClasses were found, only 1 allowed"))), | ||
expectedClass: utilpointer.StringPtr(defaultClass1.Name), | ||
expectedError: nil, |
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.
minor: we don't need to set this field to nil - it's just noise
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.
May I ask which field you are talking about? If it is expectedError
, we have to set it to nil,since we no longer return error when there are two or more ingressClasses.
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.
not setting the field, leaving it empty, has the same effect to set it to nil
expectedError: nil, |
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.
but it was already this way, and seems there are other test cases setting it
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.
Yes,And I set the field to nil in order to keep the format uniform, should we delete the nil field for all the tests?
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 would normally argue to remove it all over, but that can be a different PR
2393e25
to
8315dcd
Compare
if defaultClasses[i].CreationTimestamp.UnixNano() == defaultClasses[j].CreationTimestamp.UnixNano() { | ||
return defaultClasses[i].Name < defaultClasses[j].Name | ||
} |
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.
this test cases is missing, two defaults same timestamp, choose the one with the lower name
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 think this test has already done it.It has two deault classes with createTime equal to 0. I have updated expectedClass
field in the commit. I will also update the test name.
/ok-to-test |
8315dcd
to
60b18fb
Compare
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kidddddddddddddddddddddd, thockin 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 |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
I'll create a pr to fix this and ping you in that pr. |
I'm wondering how we'll document this. It feels difficult to explain clearly. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
When there are two or more defaults, choose one based on class name instead of returning an error.
See #110514 for more information.
Which issue(s) this PR fixes:
Part of #110514
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: