Skip to content
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

Closed

Conversation

youngnick
Copy link
Contributor

@youngnick youngnick commented Aug 25, 2023

/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?:

Clarified that ParentRefs must be distinct.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/test area/conformance labels Aug 25, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 25, 2023
@youngnick youngnick added the release-blocker MUST be completed to complete the milestone label Aug 25, 2023
@youngnick youngnick added this to the v1.0.0 milestone Aug 25, 2023
@youngnick youngnick force-pushed the add-indistinct-parentref branch 2 times, most recently from a018257 to 6651d2c Compare August 29, 2023 05:02
@youngnick youngnick force-pushed the add-indistinct-parentref branch from 6651d2c to a5152ca Compare August 29, 2023 05:26
@youngnick
Copy link
Contributor Author

/hold

for multiple review if necessary.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 29, 2023
@shaneutt
Copy link
Member

/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"
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copyright 2022 The Kubernetes Authors.
Copyright 2023 The Kubernetes Authors.

Copy link
Member

@robscott robscott left a 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.

Comment on lines +320 to +323
// 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"
Copy link
Member

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.

Copy link
Member

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.

@gauravkghildiyal
Copy link
Member

/cc

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2023
@k8s-ci-robot
Copy link
Contributor

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.

@robscott
Copy link
Member

Closing in favor of #2433 (which copies some of the content from this one).

/close

@k8s-ci-robot
Copy link
Contributor

@robscott: Closed this PR.

In response to this:

Closing in favor of #2433 (which copies some of the content from this one).

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/test needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-blocker MUST be completed to complete the milestone release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
No open projects
5 participants