Skip to content

Commit

Permalink
Fix logic to load policies from all namespaces
Browse files Browse the repository at this point in the history
When kube-mgmt was started with the "--policies=*" option, it would set the array of namespaces with an emtpy string as its only element. This would break the logic of how namespaces are matched thereby not annotating configmaps containing policy and hence policies would not be loaded.

Fixes: #55
Signed-off-by: Ashutosh Narkar <[email protected]>
  • Loading branch information
ashutosh-narkar committed Jan 30, 2020
1 parent 5c1724f commit 3a22a42
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/configmap/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,10 @@ func (s *Sync) Run(namespaces []string) (chan struct{}, error) {
}
quit := make(chan struct{})

if namespaces[0] == "*" {
namespaces[0] = v1.NamespaceAll
namespaces = namespaces[0:1]
}

for _, namespace := range namespaces {
if namespace == "*" {
namespace = v1.NamespaceAll
}
source := cache.NewListWatchFromClient(
client,
"configmaps",
Expand Down

0 comments on commit 3a22a42

Please sign in to comment.