Skip to content

Commit 7f2632a

Browse files
dobrerazvanaguzovatii
authored andcommitted
[INTERNAL] Get watched namespaces from env variable (#75)
(cherry picked from commit de6500b)
1 parent 254cc1c commit 7f2632a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ func main() {
124124
watchedNamespaces := make(map[string]cache.Config)
125125
if namespaces != "" {
126126
namespaceList = strings.Split(namespaces, ",")
127-
for i := range namespaceList {
128-
watchedNamespaces[strings.TrimSpace(namespaceList[i])] = cache.Config{}
129-
}
127+
} else {
128+
namespaces = os.Getenv("WATCH_NAMESPACE")
129+
namespaceList = strings.Split(namespaces, ",")
130+
}
131+
for i := range namespaceList {
132+
watchedNamespaces[strings.TrimSpace(namespaceList[i])] = cache.Config{}
130133
}
131134

132135
// hash the watched namespaces to allow for more than one operator deployment per namespace

0 commit comments

Comments
 (0)