Skip to content

Commit c2a01d1

Browse files
authored
Use OPERATOR_NAMESPACE to set operating namespace for secrets
1 parent d2bdde9 commit c2a01d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,15 @@ func setupManager(
148148

149149
// limit Manager to cerberus namespace
150150
NewCache: func(config *rest.Config, opts controllercache.Options) (controllercache.Cache, error) {
151+
operatorNamespace := os.Getenv("OPERATOR_NAMESPACE")
152+
if operatorNamespace == "" {
153+
operatorNamespace = "cerberus-operator-system"
154+
}
155+
151156
opts.ByObject = make(map[client.Object]controllercache.ByObject)
152157
opts.ByObject[&v1.Secret{}] = controllercache.ByObject{
153158
Namespaces: map[string]controllercache.Config{
154-
"cerberus-operator-system": {},
159+
operatorNamespace: {},
155160
},
156161
}
157162

0 commit comments

Comments
 (0)