Skip to content

bug: Installation of a new Promise triggers all RR to run a new workflow, even if they are pinned to an unrelated version #815

@aclevername

Description

@aclevername

to reproduce:

  1. install promise at v1
  2. make two requests, A and B
  3. pin request A to v1 and B to latest
  4. install promise at v2
  5. observe both A and B have there pipelines run

We should change the behavior so instead only pipeline B runs.

The code responsible for this problem is here:

func (r *PromiseReconciler) reconcileAllRRs(ctx context.Context, rrGVK *schema.GroupVersionKind) error {
//label all rr with manual reconciliation
rrs := &unstructured.UnstructuredList{}
rrListGVK := *rrGVK
rrListGVK.Kind = rrListGVK.Kind + "List"
rrs.SetGroupVersionKind(rrListGVK)
err := r.Client.List(ctx, rrs)
if err != nil {
return err
}
for _, rr := range rrs.Items {
newLabels := rr.GetLabels()
if newLabels == nil {
newLabels = make(map[string]string)
}
newLabels[resourceutil.ManualReconciliationLabel] = "true"
rr.SetLabels(newLabels)
if err := r.Client.Update(ctx, &rr); err != nil {
return err
}
}
return nil
}

We should filter through the requests depending on what the corresponding binding reference as the desired version, and only trigger those who match the newly installed promise. So only the bindings that are on latest or pinned to the version that was just installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions