-
Notifications
You must be signed in to change notification settings - Fork 221
Separate interface for cleanup part of reconciler and Dependent Resources #1035
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c01b7d7
feat: separate cleaner interface from reconciler
csviri 9dcfe42
fix: builds without tests
csviri 21cc194
wip
csviri ff1aa95
fix: unit tests
csviri 14ec0d7
fix: integration tests
csviri 94b68da
fix: integration tests
csviri 6c33fa5
fix: format
csviri 8416246
fix: added integration test
csviri 396b5a1
docs: update docs
csviri 4831df7
fix: format
csviri 7360e66
fix: rename
csviri aa1a2b6
feat: separate cleaner interface for DependetResource
csviri 6f5dfb8
refactor: dependent resources package structure
csviri b12f728
fix: use finalizer if dependent resources are cleaners
csviri bb1b135
fix: mysql using the current approach without finalizer
csviri 49ef6c7
fix: reconciler cleaner IT
csviri e41bf14
fix: managed dependent resource IT
csviri 1443d1d
fix: additional unit tests
csviri cf5c716
refactor: simplify
metacosm 2563bae
refactor: avoid looping over dependents twice to check for Cleaner
metacosm 3a68a09
fix: class rename
csviri da8424b
Merge branch 'separate-cleanup' of github.com:java-operator-sdk/java-…
csviri ae75dcf
Merge branch 'separate-cleanup' of github.com:java-operator-sdk/java-…
csviri 6935c2e
Update operator-framework-core/src/main/java/io/javaoperatorsdk/opera…
csviri 4616838
Update operator-framework-core/src/main/java/io/javaoperatorsdk/opera…
csviri 09c20f9
Update operator-framework-core/src/main/java/io/javaoperatorsdk/opera…
csviri a024bc3
fix: fixes from CR
csviri e3dd811
Merge branch 'separate-cleanup' of github.com:java-operator-sdk/java-…
csviri 6024cd0
Merge branch 'next' into separate-cleanup
csviri de52b3c
refactor: minor optimizations
metacosm 606480e
refactor: remove unneeded classes
metacosm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Cleaner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.javaoperatorsdk.operator.api.reconciler; | ||
|
||
import io.fabric8.kubernetes.api.model.HasMetadata; | ||
|
||
public interface Cleaner<P extends HasMetadata> { | ||
|
||
/** | ||
* Note that this method turns on automatic finalizer usage. | ||
* | ||
* The implementation should delete the associated component(s). This method is called when an | ||
* object is marked for deletion. After it's executed the custom resource finalizer is | ||
* automatically removed by the framework; unless the return value is | ||
* {@link DeleteControl#noFinalizerRemoval()}, which indicates that the controller has determined | ||
* that the resource should not be deleted yet. This is usually a corner case, when a cleanup is | ||
* tried again eventually. | ||
* | ||
* <p> | ||
* It's important for implementations of this method to be idempotent, since it can be called | ||
* several times. | ||
* | ||
* @param resource the resource that is marked for deletion | ||
* @param context the context with which the operation is executed | ||
* @return {@link DeleteControl#defaultDelete()} - so the finalizer is automatically removed after | ||
* the call. {@link DeleteControl#noFinalizerRemoval()} if you don't want to remove the | ||
* finalizer to indicate that the resource should not be deleted after all, in which case | ||
* the controller should restore the resource's state appropriately. | ||
*/ | ||
DeleteControl cleanup(P resource, Context<P> context); | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...endent/DependentResourceConfigurator.java → ...anaged/DependentResourceConfigurator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...iler/dependent/KubernetesClientAware.java → ...endent/managed/KubernetesClientAware.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.