From cd0298b1d6d175e00b770deb9e7f1e786b76b383 Mon Sep 17 00:00:00 2001 From: Marco Nenciarini Date: Sun, 23 Feb 2025 23:18:38 +0100 Subject: [PATCH] chore: remove unused Cluster informer cache Signed-off-by: Marco Nenciarini --- internal/cnpgi/restore/manager.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/internal/cnpgi/restore/manager.go b/internal/cnpgi/restore/manager.go index 9503aee..85aeafa 100644 --- a/internal/cnpgi/restore/manager.go +++ b/internal/cnpgi/restore/manager.go @@ -6,12 +6,10 @@ import ( cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1" "github.com/spf13/viper" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" @@ -30,23 +28,9 @@ func init() { func Start(ctx context.Context) error { setupLog := log.FromContext(ctx) setupLog.Info("Starting barman cloud instance plugin") - namespace := viper.GetString("namespace") - clusterName := viper.GetString("cluster-name") - - objs := map[client.Object]cache.ByObject{ - &cnpgv1.Cluster{}: { - Field: fields.OneTermEqualSelector("metadata.name", clusterName), - Namespaces: map[string]cache.Config{ - namespace: {}, - }, - }, - } mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - Cache: cache.Options{ - ByObject: objs, - }, Client: client.Options{ Cache: &client.CacheOptions{ DisableFor: []client.Object{