aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/controller.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-09-22 18:13:33 +0100
committerGravatar GitHub <noreply@github.com> 2018-09-22 18:13:33 +0100
commit6f966eed41912ce5eeae7584f9f220f824f8815e (patch)
treeb87d98f5994b1a3fcca4b254ba4304984e6c39f8 /plugin/kubernetes/controller.go
parentf98db6b637ed802e900e600495f376acf40bea10 (diff)
downloadcoredns-6f966eed41912ce5eeae7584f9f220f824f8815e.tar.gz
coredns-6f966eed41912ce5eeae7584f9f220f824f8815e.tar.zst
coredns-6f966eed41912ce5eeae7584f9f220f824f8815e.zip
plugin/kubernetes: use struct{} was map values (#2125)
This takes less space than a bool, the value isn't used for anything else than "present in map" any way. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/kubernetes/controller.go')
-rw-r--r--plugin/kubernetes/controller.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/kubernetes/controller.go b/plugin/kubernetes/controller.go
index 0a66c2b1a..1c4dd4e3d 100644
--- a/plugin/kubernetes/controller.go
+++ b/plugin/kubernetes/controller.go
@@ -81,7 +81,7 @@ type dnsControl struct {
// watch-related items channel
watchChan dnswatch.Chan
- watched map[string]bool
+ watched map[string]struct{}
zones []string
endpointNameMode bool
}
@@ -105,7 +105,7 @@ func newdnsController(kubeClient *kubernetes.Clientset, opts dnsControlOpts) *dn
client: kubeClient,
selector: opts.selector,
stopCh: make(chan struct{}),
- watched: make(map[string]bool),
+ watched: make(map[string]struct{}),
zones: opts.zones,
endpointNameMode: opts.endpointNameMode,
}
@@ -287,7 +287,7 @@ func (dns *dnsControl) Watch(qname string) error {
if dns.watchChan == nil {
return fmt.Errorf("cannot start watch because the channel has not been set")
}
- dns.watched[qname] = true
+ dns.watched[qname] = struct{}{}
return nil
}