Skip to content

Commit 3471a3c

Browse files
committed
TraitsController: Fix logic inversion on yield in traits
A false returned from yield means no more items, so we need to break there out of the loop.
1 parent d431a06 commit 3471a3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/controller/traits_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (tc *TraitsController) Reconcile(ctx context.Context, req ctrl.Request) (ct
7373

7474
customTraitsApplied := slices.Collect(func(yield func(string) bool) {
7575
for _, trait := range hv.Status.Traits {
76-
if strings.HasPrefix(trait, customPrefix) && yield(trait) {
76+
if strings.HasPrefix(trait, customPrefix) && !yield(trait) {
7777
return
7878
}
7979
}

0 commit comments

Comments
 (0)