@@ -3,11 +3,15 @@ package main
3
3
import (
4
4
"context"
5
5
6
+ appsv1 "k8s.io/api/apps/v1"
6
7
corev1 "k8s.io/api/core/v1"
8
+ rbacv1 "k8s.io/api/rbac/v1"
9
+ apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
7
10
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8
11
"k8s.io/apimachinery/pkg/labels"
9
12
"k8s.io/apimachinery/pkg/runtime"
10
13
"k8s.io/apimachinery/pkg/selection"
14
+ apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
11
15
ctrl "sigs.k8s.io/controller-runtime"
12
16
"sigs.k8s.io/controller-runtime/pkg/cache"
13
17
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -53,6 +57,36 @@ func Manager(ctx context.Context, debug bool) (ctrl.Manager, error) {
53
57
MetricsBindAddress : "0" , // TODO(njhale): Enable metrics on non-conflicting port (not 8080)
54
58
Cache : cache.Options {
55
59
ByObject : map [client.Object ]cache.ByObject {
60
+ & appsv1.Deployment {}: {
61
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
62
+ },
63
+ & corev1.Service {}: {
64
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
65
+ },
66
+ & apiextensionsv1.CustomResourceDefinition {}: {
67
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
68
+ },
69
+ & apiregistrationv1.APIService {}: {
70
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
71
+ },
72
+ & corev1.ConfigMap {}: {
73
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
74
+ },
75
+ & corev1.ServiceAccount {}: {
76
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
77
+ },
78
+ & rbacv1.Role {}: {
79
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
80
+ },
81
+ & rbacv1.RoleBinding {}: {
82
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
83
+ },
84
+ & rbacv1.ClusterRole {}: {
85
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
86
+ },
87
+ & rbacv1.ClusterRoleBinding {}: {
88
+ Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
89
+ },
56
90
& corev1.Secret {}: {
57
91
Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
58
92
},
0 commit comments