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

Added empty FinalizeKind definition to prevent delete sources from hanging #3113

Conversation

Cali0707
Copy link
Member

Fixes #3070

Proposed Changes

  • Add empty definition for FinalizeKind to ensure that deleting a source does not hang if it has a finalizer

Release Note

Fixed bug where deleting sources created before the sourcev2 upgrade caused the source to hang on finalization.

@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/control-plane labels May 29, 2023
@Cali0707
Copy link
Member Author

/cc @pierDipi

@knative-prow knative-prow bot requested a review from pierDipi May 29, 2023 15:38
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Merging #3113 (c6e2a4f) into main (39fd4b3) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main    #3113      +/-   ##
============================================
- Coverage     63.42%   63.41%   -0.02%     
  Complexity      758      758              
============================================
  Files           167      167              
  Lines         11354    11356       +2     
  Branches        233      233              
============================================
  Hits           7201     7201              
- Misses         3626     3628       +2     
  Partials        527      527              
Flag Coverage Δ
java-unittests 81.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
control-plane/pkg/reconciler/source/source.go 88.15% <0.00%> (-1.18%) ⬇️

... and 1 file with indirect coverage changes

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 29, 2023
@Cali0707
Copy link
Member Author

To resolve the unit tests issue take a look at how we were setting up the test with WantPatches and WantEvents on the branch 1.5:

* https://github.com/knative-sandbox/eventing-kafka-broker/blob/94a5ad58082d5a590b296b440f793cb972f40468/control-plane/pkg/reconciler/source/source_test.go#L136-L141

* https://github.com/knative-sandbox/eventing-kafka-broker/blob/94a5ad58082d5a590b296b440f793cb972f40468/control-plane/pkg/reconciler/source/source_test.go#L614-L621

* https://github.com/knative-sandbox/eventing-kafka-broker/blob/94a5ad58082d5a590b296b440f793cb972f40468/control-plane/pkg/reconciler/source/source_test.go#L66-L72

Just checked those out and try to follow it, thanks for your help!!

@Cali0707
Copy link
Member Author

/retest

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2023
@knative-prow
Copy link

knative-prow bot commented May 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cali0707, pierDipi

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2023
@knative-prow knative-prow bot merged commit e45c5fe into knative-extensions:main May 30, 2023
@pierDipi
Copy link
Member

/cherry-pick release-1.10

@pierDipi
Copy link
Member

/cherry-pick release-1.9

@knative-prow-robot
Copy link
Contributor

@pierDipi: #3113 failed to apply on top of branch "release-1.10":

Applying: Added empty FinalizeKind definition to prevent delete sources from hanging
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/source/source.go
Falling back to patching base and 3-way merge...
Auto-merging control-plane/pkg/reconciler/source/source.go
Applying: Updated tests to handle reintroduction of finalizer patch events
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/source/source_test.go
Falling back to patching base and 3-way merge...
Auto-merging control-plane/pkg/reconciler/source/source_test.go
CONFLICT (content): Merge conflict in control-plane/pkg/reconciler/source/source_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Updated tests to handle reintroduction of finalizer patch events
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.10

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.

@knative-prow-robot
Copy link
Contributor

@pierDipi: #3113 failed to apply on top of branch "release-1.9":

Applying: Added empty FinalizeKind definition to prevent delete sources from hanging
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/source/source.go
Falling back to patching base and 3-way merge...
Auto-merging control-plane/pkg/reconciler/source/source.go
Applying: Updated tests to handle reintroduction of finalizer patch events
Using index info to reconstruct a base tree...
M	control-plane/pkg/reconciler/source/source_test.go
Falling back to patching base and 3-way merge...
Auto-merging control-plane/pkg/reconciler/source/source_test.go
CONFLICT (content): Merge conflict in control-plane/pkg/reconciler/source/source_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Updated tests to handle reintroduction of finalizer patch events
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.9

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 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
Cali0707 added a commit to Cali0707/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
knative-prow bot pushed a commit that referenced this pull request May 30, 2023
…nging (#3113) (#3116)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
knative-prow bot pushed a commit that referenced this pull request May 30, 2023
…nging (#3113) (#3115)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113) (#707)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this pull request May 30, 2023
…nging (knative-extensions#3113) (#706)

* Added empty FinalizeKind definition to prevent delete sources from hanging

* Updated tests to handle reintroduction of finalizer patch events
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/control-plane lgtm Indicates that a PR is ready to be merged. 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.

Sources created before sourcev2 upgrade cause the source to be stuck on finalization
3 participants