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

Stateful triggers #1682

Open
JPaja opened this issue Jan 26, 2025 · 0 comments
Open

Stateful triggers #1682

JPaja opened this issue Jan 26, 2025 · 0 comments

Comments

@JPaja
Copy link

JPaja commented Jan 26, 2025

Would you like to work on this feature?

yes

What problem are you trying to solve?

Currently internal trigger functions (watches, owns, etc..) cannot reconcile parent reference when resource is removed or reference inside resource is modified/removed.

Because of this managing Custom Resources like Service that rely on selectors is much harder.

Describe the solution you'd like

create *_stateful' variant of internal trigger functions (trigger_with,trigger_others, trigger_others_shared, trigger_owners, trigger_owners_shared`)

where new implementation trigger_with (trigger_with_stateful) would create new Mapper stream that would contain state.
State would have some kind of HashMap that would keep previously produced ObjectReferences from mapper function. If cached ObjectReference is not included in new mapper result, it would still produce ReconcileRequest and it would be removed from cache.

And potentially new ReconcileReason could be added ObjectRelationRemoved { obj_ref: Box<ObjectRef<DynamicObject>> }

Describe alternatives you've considered

Alternative of creating _stateful variant of functions would be to add new parameter to watcher::Config that would enable relation caching.

Documentation, Adoption, Migration Strategy

No response

Target crate for feature

kube-runtime

@JPaja JPaja changed the title Stateful trigger_others Stateful triggers Jan 26, 2025
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

No branches or pull requests

1 participant