Skip to content

Commit

Permalink
Tweak ResourceManager name
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Andrews <scott@andrews.me>
  • Loading branch information
scothis committed Oct 1, 2024
1 parent f4d3160 commit a6bc711
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reconcilers/objectmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (p *Patch) Apply(rebase client.Object) error {
// The type is duplicated because generics are not supported in type aliases.
// See https://github.com/golang/go/issues/46477#issuecomment-852701491
type ResourceManager[Type client.Object] struct {
// Name used to identify this reconciler. Defaults to `{Type}UpdatingObjectManager`. Ideally
// Name used to identify this reconciler. Defaults to `{Type}ResourceManager`. Ideally
// unique, but not required to be so.
//
// +optional
Expand Down Expand Up @@ -391,6 +391,9 @@ type ResourceManager[Type client.Object] struct {

func (r *ResourceManager[T]) init() {
r.lazyInit.Do(func() {
if r.Name == "" {
r.Name = fmt.Sprintf("%sResourceManager", typeName(r.Type))
}
r.internal = &UpdatingObjectManager[T]{
Name: r.Name,
Type: r.Type,
Expand Down

0 comments on commit a6bc711

Please sign in to comment.