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

Finalizer helper #475

Merged
merged 11 commits into from
Jul 2, 2021
Merged

Finalizer helper #475

merged 11 commits into from
Jul 2, 2021

Conversation

nightkr
Copy link
Member

@nightkr nightkr commented Mar 25, 2021

Imported from https://gitlab.com/teozkr/kube-finalizer, with some docs cleanup.

Fixes #291

Not super happy with the API, but think it would still be useful to get some external feedback..

Imported from https://gitlab.com/teozkr/kube-finalizer, with some docs cleanup.
@nightkr nightkr requested review from clux and kazk March 25, 2021 00:56
kube-runtime/src/finalizer.rs Outdated Show resolved Hide resolved
Comment on lines 82 to 88
) -> Result<ReconcilerAction, Error<ApplyFut::Error, CleanupFut::Error>>
where
K: Metadata<Ty = ObjectMeta> + Clone + DeserializeOwned + Serialize + Debug,
ApplyFut: TryFuture<Ok = ReconcilerAction>,
ApplyFut::Error: StdError + 'static,
CleanupFut: TryFuture<Ok = ()>,
CleanupFut::Error: StdError + 'static,

This comment was marked as outdated.

kube-runtime/src/finalizer.rs Outdated Show resolved Hide resolved
kube-runtime/src/finalizer.rs Outdated Show resolved Hide resolved
kube-runtime/src/finalizer.rs Outdated Show resolved Hide resolved
kube-runtime/src/finalizer.rs Outdated Show resolved Hide resolved
@nightkr nightkr marked this pull request as ready for review June 29, 2021 16:48
@nightkr nightkr requested a review from clux June 30, 2021 23:21
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

I think this is great. It looks like this resolves all my previous concerns about it being hard to read, and it also looks like you've found a really nice way to nest the error types with one error type in your finalizer that nests the users error type that must be the same in apply and cleanup.

I don't think this needs any real changes before merging. Have only left minor readability nits on the example.

examples/secret_syncer.rs Outdated Show resolved Hide resolved
examples/secret_syncer.rs Show resolved Hide resolved
examples/secret_syncer.rs Outdated Show resolved Hide resolved
@nightkr nightkr requested a review from clux July 2, 2021 03:48
@nightkr nightkr merged commit 856d6fc into kube-rs:master Jul 2, 2021
@nightkr nightkr deleted the feature/finalizer branch July 2, 2021 03:55
@clux
Copy link
Member

clux commented Jul 5, 2021

released in 0.58 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finalizer helper
2 participants