@@ -3,15 +3,10 @@ package main
3
3
import (
4
4
"context"
5
5
6
- appsv1 "k8s.io/api/apps/v1"
7
- corev1 "k8s.io/api/core/v1"
8
- rbacv1 "k8s.io/api/rbac/v1"
9
- apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
10
6
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
7
"k8s.io/apimachinery/pkg/labels"
12
8
"k8s.io/apimachinery/pkg/runtime"
13
9
"k8s.io/apimachinery/pkg/selection"
14
- apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
15
10
ctrl "sigs.k8s.io/controller-runtime"
16
11
"sigs.k8s.io/controller-runtime/pkg/cache"
17
12
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -56,40 +51,8 @@ func Manager(ctx context.Context, debug bool) (ctrl.Manager, error) {
56
51
Scheme : scheme ,
57
52
MetricsBindAddress : "0" , // TODO(njhale): Enable metrics on non-conflicting port (not 8080)
58
53
Cache : cache.Options {
54
+ DefaultLabelSelector : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
59
55
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
- },
90
- & corev1.Secret {}: {
91
- Label : labels .SelectorFromValidatedSet (map [string ]string {install .OLMManagedLabelKey : install .OLMManagedLabelValue }),
92
- },
93
56
& operatorsv1alpha1.ClusterServiceVersion {}: {
94
57
Label : copiedLabelDoesNotExist ,
95
58
},
0 commit comments