Skip to content

Commit

Permalink
BUG/MINOR: Use slice instead of static sized arrays
Browse files Browse the repository at this point in the history
Since whitelisted namespaces were being appended anyways, the first entries in the
namespaces were all empty strings thus causing ingress controller to access
k8s resources on a cluster level unnecessary.

Signed-off-by: Daniel Lenar <dlenar@vailsys.com>
  • Loading branch information
danlenar authored and ivanmatmati committed Apr 25, 2022
1 parent 97971c2 commit 3d15d2d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controller/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ func (c *HAProxyController) getWhitelistedNamespaces() []string {
if len(c.Store.NamespacesAccess.Whitelist) == 0 {
return []string{""}
}
// Add one because of potential whitelisting of configmap namespace
namespaces := make([]string, len(c.Store.NamespacesAccess.Whitelist)+1)
namespaces := []string{}
for ns := range c.Store.NamespacesAccess.Whitelist {
namespaces = append(namespaces, ns)
}
Expand Down

0 comments on commit 3d15d2d

Please sign in to comment.