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

runnable: keep track of selected object / watch for new selections #996

Open
cirocosta opened this issue Aug 26, 2022 · 0 comments
Open

Comments

@cirocosta
Copy link
Contributor

cirocosta commented Aug 26, 2022

Description of problem

In the current form that the reconciler deals with how spec.selector finds the objects matching the selection

func (r *runnableRealizer) resolveSelector(ctx context.Context, selector *v1alpha1.ResourceSelector, repository repository.Repository, discoveryClient discovery.DiscoveryInterface, namespace string) (map[string]interface{}, error) {

there is no mechanism of automatically producing a reconciliation request either in case:

  • the object selected changes (e.g., tekton/Pipeline being updated)
  • an object that would match the selector is created (e.g., tekton/Pipeline that didn't exist before now exists)

lacking such mechanism means that folks using Runnable as a resource in Cartographer usually gets surprised by the fact that they've updated their pipeline (or created one after Workload got created) and then having to resort to either deleting the Runnable (and letting cartographer go ahead and create a new one for them) or tweaking a field (like placing a dummy annotation) just to trigger a reconciliation.

Proposed solution

Perhaps

  • use the dynamic watching capability we have in place whenever we match the selection?
  • watch the whole gvr in the namespace regardless of whether we have a selection in place or not (to catch creations)?

Just a few suggestions without thinking much.

Example

  1. create a runnable that has selector pointing at objects of a gvr with a given label
  2. see that it's not happy by not finding an object
  3. create the object
  4. see that runnable is still not happy (as it didn't reconcile again)
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