Skip to content

✨ Use apimachinery sets instead of maps #933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/controllers/clusterextension_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type ClusterExtensionReconciler struct {
Storage storage.Storage
Handler registryv1handler.Handler
dynamicWatchMutex sync.RWMutex
dynamicWatchGVKs map[schema.GroupVersionKind]struct{}
dynamicWatchGVKs sets.Set[schema.GroupVersionKind]
controller crcontroller.Controller
cache cache.Cache
InstalledBundleGetter InstalledBundleGetter
Expand Down Expand Up @@ -346,7 +346,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
); err != nil {
return err
}
r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] = struct{}{}
r.dynamicWatchGVKs[obj.GetObjectKind().GroupVersionKind()] = sets.Empty{}
}
return nil
}(); err != nil {
Expand Down Expand Up @@ -582,7 +582,7 @@ func (r *ClusterExtensionReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
r.controller = controller
r.cache = mgr.GetCache()
r.dynamicWatchGVKs = map[schema.GroupVersionKind]struct{}{}
r.dynamicWatchGVKs = sets.New[schema.GroupVersionKind]()

return nil
}
Expand Down
Loading