-
Notifications
You must be signed in to change notification settings - Fork 492
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 handling for indistinct ParentRefs with conformance tests #2350
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: youngnick 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 |
a018257
to
6651d2c
Compare
Signed-off-by: Nick Young <[email protected]>
6651d2c
to
a5152ca
Compare
/hold for multiple review if necessary. |
/cc |
// multiple ParentRefs that are not distinct. See the ParentRef | ||
// definition for the definition of distinct. | ||
RouteReasonParentsNotDistinct RouteConditionReason = "ParentsNotDistinct" | ||
|
||
// This reason is used with the "Accepted" condition when a value for an Enum | ||
// is not recognized. | ||
RouteReasonUnsupportedValue RouteConditionReason = "UnsupportedValue" |
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'm pretty happy with the language changes in here 👍
We should make sure we hold for @robscott before merging.
/hold
@@ -0,0 +1,76 @@ | |||
/* | |||
Copyright 2022 The Kubernetes Authors. |
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.
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.
Thanks @youngnick! Mostly LGTM, just one question on how this will work in practice.
// This reason is used with the "Accepted" condition when there are | ||
// multiple ParentRefs that are not distinct. See the ParentRef | ||
// definition for the definition of distinct. | ||
RouteReasonParentsNotDistinct RouteConditionReason = "ParentsNotDistinct" |
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 do we want to happen in the following case?
parentRefs:
- name: "foo"
- name: "foo"
sectionName: "bar"
Do we always want status to look something like this?
status:
parents:
- parentRef:
- name: foo
conditions:
type: Accepted
status: True
- parentRef:
- name: foo
sectionName: Bar
conditions:
type: Accepted
status: False
reason: ParentsNotDistinct
Or do we always want to consider both parents unaccepted in this state? I'd argue that it makes sense to accept one of the indistinct parents, preferably the oldest/first one.
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.
We talked about this one on the meeting today, and decided we should see if CEL can provide validation to protect us from these situations.
/cc |
PR needs rebase. 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. |
Closing in favor of #2433 (which copies some of the content from this one). /close |
@robscott: Closed this PR. In response to this:
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. |
/kind cleanup
/kind test
/area conformance
-->
What this PR does / why we need it:
This PR adds clarity around how ParentRefs must be distinct, with conformance tests to verify.
Which issue(s) this PR fixes:
Fixes #2326
Fixes #1925
Does this PR introduce a user-facing change?: