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

feature request: composite triggers #14

Open
s-urbaniak opened this issue Jan 8, 2021 · 6 comments
Open

feature request: composite triggers #14

s-urbaniak opened this issue Jan 8, 2021 · 6 comments
Assignees

Comments

@s-urbaniak
Copy link
Contributor

Hello and thank you for this great project! :-)

As of today locutus supports three types of triggers (interval, oneoff, and resource) which can be used exclusively but not in combination.

To be used as an operator replacement I could think of yet another trigger type, namely a composite type which could leverage existing "primitive" triggers.

I am thinking of the following use cases. If locutus is started as a long running process it should:

  • reconcile immediately after startup (essentially oneoff)
  • additionally reconcile every x minutes (essentially interval)
  • additionally reconcile on resource events (essentially resource)

UX:
Suggested command line option could be --trigger=composite with comma-separated list of triggers --trigger.composite=oneoff,interval,resource and the existing trigger specific configurations.

Another idea would be to allow multiple --trigger declarations, i.e. --trigger=oneoff --trigger=interval --trigger=resource.

Does that make any sense or is it actually preferable to have dedicated triggers only?

cc @paulfantom

@paulfantom
Copy link

I think that if we treat locutus as a library for building a solution, then having a composite trigger can be solved on the higher level.

@s-urbaniak
Copy link
Contributor Author

Hmm, but then each consuming project would have to implement the trigger interface separately for compositing 🤔

@brancz
Copy link
Owner

brancz commented Jan 11, 2021

reconcile immediately after startup (essentially oneoff)

I believe this is already the case, as filling the informer triggers reconciles for each of the initial objects.

Happy with introducing the option to do both interval and resource together!

@s-urbaniak
Copy link
Contributor Author

self-assigning to this one.

@brancz brancz assigned brancz and s-urbaniak and unassigned brancz Jan 13, 2021
@brancz
Copy link
Owner

brancz commented Jan 13, 2021

Actually I could think of a useful case for one-off with resource together. Essentially this would mean that we stop the process after all items are worked off that were added to the informers on the initial list of the ListWatch. I have no idea whether this would be possible to do, but it would certainly be super useful in development.

@bwplotka
Copy link

That would be super awesome to see indeed 👍🏽

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

4 participants