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

Reconcile ET properly with no reference #7423

Closed
wants to merge 6 commits into from

Conversation

Cali0707
Copy link
Member

@Cali0707 Cali0707 commented Oct 31, 2023

Fixes #7264

Feature track: https://docs.google.com/document/d/1US5Ve0CwhXwO8pUudN36vLkuSetEtSgwQ1btuG_9Xmk/edit

Proposed Changes

  • Update the reconciler to check if the reference is set before validating the reference
  • Add a new status helper function for when the reference is not set

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note

EventTypes no longer need a reference to reconcile.

Docs

@knative-prow knative-prow bot requested review from creydr and odacremolbap October 31, 2023 20:28
Copy link

knative-prow bot commented Oct 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707

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

@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 31, 2023
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (79bb385) 76.63% compared to head (56346e9) 75.55%.
Report is 27 commits behind head on main.

Files Patch % Lines
pkg/apis/eventing/v1beta3/eventtype_lifecycle.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7423      +/-   ##
==========================================
- Coverage   76.63%   75.55%   -1.09%     
==========================================
  Files         259      261       +2     
  Lines       14270    14673     +403     
==========================================
+ Hits        10936    11086     +150     
- Misses       2778     3008     +230     
- Partials      556      579      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Calum Murray <[email protected]>
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 1, 2023
@matzew
Copy link
Member

matzew commented Nov 16, 2023

/hold

Let's do this in ET_v1b3, not in this v1b2 version!

See: #7304

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 16, 2023
Comment on lines +42 to +45
// 1. Check if there is a reference
// a) if not, reconcile to true
// b) if yes, continue reconciling
// 2. Verify the Reference exists.
Copy link
Member

Choose a reason for hiding this comment

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

I like having this comment here. thx

Comment on lines +34 to +35
func NewEventType(name, namespace string, o ...EventTypeOption) *v1beta3.EventType {
et := &v1beta3.EventType{
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should land in new package testing/v1beta3. Perhaps the package was supposed to be introduced by v1beta3 PR. :)

Copy link
Member

Choose a reason for hiding this comment

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

the v1 used to use the "latest".

I think that is OK... but we can (separately) do different?

Any comments, @Cali0707, @dsimansk ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm happy to update this either in this PR or a separate PR if we want, but this file seemed to be using v1beta2 so I had assumed it would be fine to bump to v1beta3 :)

@Cali0707
Copy link
Member Author

Cali0707 commented Dec 7, 2023

/retest-required

@matzew
Copy link
Member

matzew commented Dec 8, 2023

/hold

spec:
  description: My ET no ref
  reference:
    apiVersion: eventing.knative.dev/v1
    kind: Broker
    name: default
    namespace: default
  source: /yo/man
  type: blah.blub
status: {}

I see this still uses the wrong defaulting /cc @dsimansk

@Cali0707
Copy link
Member Author

Cali0707 commented Jan 3, 2024

@matzew I think the problem is that the cluster still has the v1beta2 CRD, not the v1beta3 CRD. When I get the CRD from the cluster after building from main, I get v1beta2.

@matzew
Copy link
Member

matzew commented Jan 4, 2024

The defaulting is just wrong, so perhaps we need to change that, we do need the CRD version. yes

That's a new different PR. See the old issues for all of this, there are a plenty of PRs that are needed in order to fully get it. Here is a list of old issues (and they have links to PRs):
https://github.com/orgs/knative/projects/62

We can also wait, and do all of that AFTER the 1.13 reelease - in order to relax things, and buy time

/cc @Cali0707 @dsimansk

@knative-prow knative-prow bot requested a review from dsimansk January 4, 2024 09:56
Copy link

knative-prow bot commented Jan 4, 2024

@matzew: GitHub didn't allow me to request PR reviews from the following users: Cali0707.

Note that only knative members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

The defaulting is just wrong, so perhaps we need to change that, we do need the CRD version. yes

That's a new different PR. See the old issues for all of this, there are a plenty of PRs that are needed in order to fully get it

We can also wait, and do all of that AFTER the 1.13 reelease - in order to relax things, and buy time

/cc @Cali0707 @dsimansk

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.

@Cali0707
Copy link
Member Author

Cali0707 commented Jan 4, 2024

The newest commit fixed the defaulting behaviour, but it uncovered the following issue:

0104 18:18:19.795077       1 reflector.go:533] k8s.io/[email protected]/tools/cache/reflector.go:231: failed to list *v1beta3.EventType: the server could not find the requested resource (get eventtypes.eventing.knative.dev)
E0104 18:18:19.795115       1 reflector.go:148] k8s.io/[email protected]/tools/cache/reflector.go:231: Failed to watch *v1beta3.EventType: failed to list *v1beta3.EventType: the server could not find the requested resource (get eventtypes.eventing.knative.dev)
W0104 18:18:20.658009       1 reflector.go:533] k8s.io/[email protected]/tools/cache/reflector.go:231: failed to list *v1beta3.EventType: the server could not find the requested resource (get eventtypes.eventing.knative.dev)

As such, I think this should be on hold until after the v1beta3 CRD is present

Signed-off-by: Calum Murray <[email protected]>
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 4, 2024
Copy link

knative-prow bot commented Jan 4, 2024

@Cali0707: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
upgrade-tests_eventing_main 56346e9 link true /test upgrade-tests
conformance-tests_eventing_main 56346e9 link true /test conformance-tests
reconciler-tests_eventing_main 56346e9 link true /test reconciler-tests

Your PR dashboard.

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.

@Cali0707 Cali0707 linked an issue Jan 5, 2024 that may be closed by this pull request
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2024
@knative-prow-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.

@pierDipi
Copy link
Member

@matzew @Cali0707 what's the status of this PR, if it's not valid anymore, can we close it ?

@Cali0707
Copy link
Member Author

@pierDipi it would work if we served a v1beta3 CRD. I could update it to work on v1beta2 if we want to change the reconcile behaviour for v1beta2 wrt no reference being an allowed state for the CRD. Otherwise, we could close this. WDYT? I'm a little confused about the current plan for event types tbh

@pierDipi
Copy link
Member

pierDipi commented Jan 22, 2024

Thanks for raising that there is confusion, let's discuss this in the working group meeting after the release

@matzew
Copy link
Member

matzew commented Jan 24, 2024

/close
as state in #7264 (comment)

@knative-prow knative-prow bot closed this Jan 24, 2024
Copy link

knative-prow bot commented Jan 24, 2024

@matzew: Closed this PR.

In response to this:

/close
as state in #7264 (comment)

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change Event Type behavior if no reference is set Eventtype defaults to a "default" broker
5 participants