Skip to content

Commit

Permalink
labellers: use unique field managers
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stevekuznetsov committed Oct 26, 2023
1 parent cda76ee commit fcbb7fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/operators/labeller/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/operators/labeller/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit fcbb7fe

Please sign in to comment.