mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
plugin/kubernetes: smaller map (#2383)
* plugin/kubernetes: smaller map
to continue with a theme: the map[string]bool can be reduced
to map[string]struct{} to reduce a tiny amount of memory.
Signed-off-by: Miek Gieben <miek@miek.nl>
* fix tests
Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -40,7 +40,7 @@ type Kubernetes struct {
|
||||
APIClientKey string
|
||||
ClientConfig clientcmd.ClientConfig
|
||||
APIConn dnsController
|
||||
Namespaces map[string]bool
|
||||
Namespaces map[string]struct{}
|
||||
podMode string
|
||||
endpointNameMode bool
|
||||
Fall fall.F
|
||||
@@ -58,7 +58,7 @@ type Kubernetes struct {
|
||||
func New(zones []string) *Kubernetes {
|
||||
k := new(Kubernetes)
|
||||
k.Zones = zones
|
||||
k.Namespaces = make(map[string]bool)
|
||||
k.Namespaces = make(map[string]struct{})
|
||||
k.interfaceAddrsFunc = func() net.IP { return net.ParseIP("127.0.0.1") }
|
||||
k.podMode = podModeDisabled
|
||||
k.ttl = defaultTTL
|
||||
|
||||
Reference in New Issue
Block a user