Skip to content

Commit 5798a4a

Browse files
authored
use apimachinery.sets instead of maps (#933)
Signed-off-by: Igor Troyanovsky <[email protected]>
1 parent 8041cc4 commit 5798a4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/controllers/clusterextension_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type ClusterExtensionReconciler struct {
8787
Storage storage.Storage
8888
Handler registryv1handler.Handler
8989
dynamicWatchMutex sync.RWMutex
90-
dynamicWatchGVKs map[schema.GroupVersionKind]struct{}
90+
dynamicWatchGVKs sets.Set[schema.GroupVersionKind]
9191
controller crcontroller.Controller
9292
cache cache.Cache
9393
InstalledBundleGetter InstalledBundleGetter
@@ -346,7 +346,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
346346
); err != nil {
347347
return err
348348
}
349-
r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] = struct{}{}
349+
r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] = sets.Empty{}
350350
}
351351
return nil
352352
}(); err != nil {
@@ -582,7 +582,7 @@ func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error {
582582
}
583583
r.controller = controller
584584
r.cache = mgr.GetCache()
585-
r.dynamicWatchGVKs = map[schema.GroupVersionKind]struct{}{}
585+
r.dynamicWatchGVKs = sets.New[schema.GroupVersionKind]()
586586

587587
return nil
588588
}

0 commit comments

Comments
 (0)