From cd323f61be4f22ffd63c3a4689a22596bca43f0e Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Thu, 26 Oct 2023 11:22:12 -0600 Subject: [PATCH] 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 --- pkg/controller/operators/labeller/labels.go | 4 ++-- pkg/controller/operators/labeller/rbac.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/operators/labeller/labels.go b/pkg/controller/operators/labeller/labels.go index fd842d3fa2..e083f49285 100644 --- a/pkg/controller/operators/labeller/labels.go +++ b/pkg/controller/operators/labeller/labels.go @@ -84,7 +84,7 @@ func ObjectLabeler[T metav1.Object, A ApplyConfig[A]]( install.OLMManagedLabelKey: install.OLMManagedLabelValue, }) - _, err := apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm"}) + _, err := apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm-ownership-labeller"}) return err } } @@ -166,7 +166,7 @@ func ObjectPatchLabeler( return fmt.Errorf("failed to create patch for %s/%s: %w", cast.GetNamespace(), cast.GetName(), err) } - _, err = patch(ctx, cast.GetName(), types.MergePatchType, patchBytes, metav1.PatchOptions{FieldManager: "olm"}) + _, err = patch(ctx, cast.GetName(), types.MergePatchType, patchBytes, metav1.PatchOptions{FieldManager: "olm-ownership-labeller"}) return err } } diff --git a/pkg/controller/operators/labeller/rbac.go b/pkg/controller/operators/labeller/rbac.go index 23d64c8e2b..dfc2e8b5cc 100644 --- a/pkg/controller/operators/labeller/rbac.go +++ b/pkg/controller/operators/labeller/rbac.go @@ -68,7 +68,7 @@ func ContentHashLabeler[T metav1.Object, A ApplyConfig[A]]( cfg.WithLabels(map[string]string{ resolver.ContentHashLabelKey: hash, }) - _, err = apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm"}) + _, err = apply(cast.GetNamespace(), ctx, cfg, metav1.ApplyOptions{FieldManager: "olm-hash-labeller"}) return err } }