Skip to content

Commit 3d15d2d

Browse files
danlenarivanmatmati
authored andcommitted
BUG/MINOR: Use slice instead of static sized arrays
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 <[email protected]>
1 parent 97971c2 commit 3d15d2d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

controller/monitor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ func (c *HAProxyController) getWhitelistedNamespaces() []string {
193193
if len(c.Store.NamespacesAccess.Whitelist) == 0 {
194194
return []string{""}
195195
}
196-
// Add one because of potential whitelisting of configmap namespace
197-
namespaces := make([]string, len(c.Store.NamespacesAccess.Whitelist)+1)
196+
namespaces := []string{}
198197
for ns := range c.Store.NamespacesAccess.Whitelist {
199198
namespaces = append(namespaces, ns)
200199
}

0 commit comments

Comments
 (0)