Skip to content

Commit fcbb7fe

Browse files
labellers: use unique field managers
It seems like using the same field manager for two distinct fields leads to the label set oscillating between the two states instead of converging to the union of both requests. Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent cda76ee commit fcbb7fe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: pkg/controller/operators/labeller/labels.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func ObjectLabeler[T metav1.Object, A ApplyConfig[A]](
8484
install.OLMManagedLabelKey: install.OLMManagedLabelValue,
8585
})
8686

87-
_, err := apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm"})
87+
_, err := apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm-ownership-labeller"})
8888
return err
8989
}
9090
}
@@ -166,7 +166,7 @@ func ObjectPatchLabeler(
166166
return fmt.Errorf("failed to create patch for %s/%s: %w", cast.GetNamespace(), cast.GetName(), err)
167167
}
168168

169-
_, err = patch(ctx, cast.GetName(), types.MergePatchType, patchBytes, metav1.PatchOptions{FieldManager: "olm"})
169+
_, err = patch(ctx, cast.GetName(), types.MergePatchType, patchBytes, metav1.PatchOptions{FieldManager: "olm-ownership-labeller"})
170170
return err
171171
}
172172
}

Diff for: pkg/controller/operators/labeller/rbac.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func ContentHashLabeler[T metav1.Object, A ApplyConfig[A]](
6868
cfg.WithLabels(map[string]string{
6969
resolver.ContentHashLabelKey: hash,
7070
})
71-
_, err = apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm"})
71+
_, err = apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm-hash-labeller"})
7272
return err
7373
}
7474
}

0 commit comments

Comments
 (0)