to reproduce:
- install promise at v1
- make two requests, A and B
- pin request A to
v1 and B to latest
- install promise at v2
- 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.
to reproduce:
v1and B tolatestWe should change the behavior so instead only pipeline B runs.
The code responsible for this problem is here:
kratix/internal/controller/promise_controller.go
Lines 1102 to 1124 in 33e7c73
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
latestor pinned to the version that was just installed.