From 11a4c71f28390d24ca027cba7fc7fe37b1937e2a Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Mon, 1 Jul 2019 14:09:25 -0700 Subject: [PATCH] Use watch-cache for etcd3 backend --- pkg/daemons/control/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/daemons/control/server.go b/pkg/daemons/control/server.go index 2c9ffdb78a..997da6ceb3 100644 --- a/pkg/daemons/control/server.go +++ b/pkg/daemons/control/server.go @@ -150,12 +150,13 @@ func apiServer(ctx context.Context, cfg *config.Control, runtime *config.Control if len(cfg.StorageEndpoint) > 0 { argsMap["etcd-servers"] = cfg.StorageEndpoint } + if cfg.StorageBackend != "etcd3" { + argsMap["watch-cache"] = "false" + } certDir := filepath.Join(cfg.DataDir, "tls/temporary-certs") os.MkdirAll(certDir, 0700) - // TODO: sqlite doesn't need the watch cache, but etcd does, so make this dynamic - argsMap["watch-cache"] = "false" argsMap["cert-dir"] = certDir argsMap["allow-privileged"] = "true" argsMap["authorization-mode"] = strings.Join([]string{modes.ModeNode, modes.ModeRBAC}, ",")