-
Notifications
You must be signed in to change notification settings - Fork 600
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
Fixed eventtype create-delete loop on built in sources #7245
Fixed eventtype create-delete loop on built in sources #7245
Conversation
Signed-off-by: Calum Murray <[email protected]>
/cc @matzew |
Signed-off-by: Calum Murray <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7245 +/- ##
==========================================
- Coverage 77.75% 77.70% -0.06%
==========================================
Files 246 247 +1
Lines 13284 13311 +27
==========================================
+ Hits 10329 10343 +14
- Misses 2433 2445 +12
- Partials 522 523 +1
☔ View full report in Codecov by Sentry. |
/test upgrade-tests |
/test reconciler-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.
/lgtm
/approve
/retest |
/retest-required |
Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, matzew 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 |
/cherry-pick release-1.11 |
@matzew: once the present PR merges, I will cherry-pick it on top of release-1.11 in a new PR and assign it to you. 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. |
@matzew: #7245 failed to apply on top of branch "release-1.11":
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. |
@matzew I will manually cherry pick this |
* Fixed eventtype create-delete loop on built in sources Signed-off-by: Calum Murray <[email protected]> * Fix unit tests Signed-off-by: Calum Murray <[email protected]> * Fixed source finalizers Signed-off-by: Calum Murray <[email protected]> * Fixed tests Signed-off-by: Calum Murray <[email protected]> --------- Signed-off-by: Calum Murray <[email protected]>
* Fixed eventtype create-delete loop on built in sources * Fix unit tests * Fixed source finalizers * Fixed tests --------- Signed-off-by: Calum Murray <[email protected]>
…knative#7250) * Fixed eventtype create-delete loop on built in sources * Fix unit tests * Fixed source finalizers * Fixed tests --------- Signed-off-by: Calum Murray <[email protected]>
…knative#7250) (#491) * Fixed eventtype create-delete loop on built in sources * Fix unit tests * Fixed source finalizers * Fixed tests --------- Signed-off-by: Calum Murray <[email protected]> Co-authored-by: Calum Murray <[email protected]>
func (r *Reconciler) FinalizeKind(ctx context.Context, source *v1.ApiServerSource) pkgreconciler.Event { | ||
logging.FromContext(ctx).Info("Deleting source") | ||
// Allow for eventtypes to be cleaned up | ||
source.Status.CloudEventAttributes = []duckv1.CloudEventAttributes{} | ||
return 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.
This update is not guaranteed to be seen by the other controller (since after FinalizeKind ends the finalizer is removed and with it the resource) and also I think there is (or there should be) an owner reference that should clean up event types associated with this source.
if eventType.Spec.Reference.Namespace == "" { | ||
eventType.Spec.Reference.Namespace = defaultNamespace | ||
} |
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.
If we want to set a namespace, the correct one is src.Namespace
, assuming default is wrong
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 we had this assumption before.
but I like this suggestion
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 did not, that was on the Broker name, which different from the reference namespace here
Fixes #7236
It appears that the eventtypes KReference in the default namespace were being retrieved with
Namespace: ""
, while the eventtypes KReference they were being compared to hadNamespace: "default"
. This caused the deep equality to fail, so they were continually deleted and recreated in the duck reconciler.Proposed Changes
Namespace = "default"
ifNamespace == ""
Pre-review Checklist
Release Note