@@ -6,12 +6,10 @@ import (
66 cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
77 "github.com/spf13/viper"
88 corev1 "k8s.io/api/core/v1"
9- "k8s.io/apimachinery/pkg/fields"
109 "k8s.io/apimachinery/pkg/runtime"
1110 utilruntime "k8s.io/apimachinery/pkg/util/runtime"
1211 clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1312 ctrl "sigs.k8s.io/controller-runtime"
14- "sigs.k8s.io/controller-runtime/pkg/cache"
1513 "sigs.k8s.io/controller-runtime/pkg/client"
1614 "sigs.k8s.io/controller-runtime/pkg/log"
1715
@@ -30,23 +28,9 @@ func init() {
3028func Start (ctx context.Context ) error {
3129 setupLog := log .FromContext (ctx )
3230 setupLog .Info ("Starting barman cloud instance plugin" )
33- namespace := viper .GetString ("namespace" )
34- clusterName := viper .GetString ("cluster-name" )
35-
36- objs := map [client.Object ]cache.ByObject {
37- & cnpgv1.Cluster {}: {
38- Field : fields .OneTermEqualSelector ("metadata.name" , clusterName ),
39- Namespaces : map [string ]cache.Config {
40- namespace : {},
41- },
42- },
43- }
4431
4532 mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
4633 Scheme : scheme ,
47- Cache : cache.Options {
48- ByObject : objs ,
49- },
5034 Client : client.Options {
5135 Cache : & client.CacheOptions {
5236 DisableFor : []client.Object {
0 commit comments