Skip to content

Commit 8427453

Browse files
fix(boxcutter): cache Secrets only in olmv1-system namespace
Configure cache to watch Secrets exclusively in olmv1-system, avoiding a cluster-wide Secret informer while maintaining performance for bundle Secret lookups via the cached client
1 parent 43351b2 commit 8427453

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmd/operator-controller/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030

3131
"github.com/spf13/cobra"
3232
"go.podman.io/image/v5/types"
33+
corev1 "k8s.io/api/core/v1"
3334
rbacv1 "k8s.io/api/rbac/v1"
3435
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
3536
apiextensionsv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
@@ -254,6 +255,13 @@ func run() error {
254255
&rbacv1.ClusterRoleBinding{}: {Label: k8slabels.Everything()},
255256
&rbacv1.Role{}: {Namespaces: map[string]crcache.Config{}, Label: k8slabels.Everything()},
256257
&rbacv1.RoleBinding{}: {Namespaces: map[string]crcache.Config{}, Label: k8slabels.Everything()},
258+
// Only cache Secrets in olmv1-system to avoid cluster-wide Secret informer.
259+
// Bundle Secrets are created in systemNamespace by SecretPacker.
260+
&corev1.Secret{}: {
261+
Namespaces: map[string]crcache.Config{
262+
cfg.systemNamespace: {},
263+
},
264+
},
257265
},
258266
DefaultNamespaces: map[string]crcache.Config{
259267
cfg.systemNamespace: {LabelSelector: k8slabels.Everything()},

0 commit comments

Comments
 (0)