Merge pull request #601 from erikwilson/watch-cache-etcd3

Use watch-cache for etcd3 backend
This commit is contained in:
Erik Wilson 2019-07-01 14:10:35 -07:00 committed by GitHub
commit 979a8ff671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,12 +150,13 @@ func apiServer(ctx context.Context, cfg *config.Control, runtime *config.Control
if len(cfg.StorageEndpoint) > 0 { if len(cfg.StorageEndpoint) > 0 {
argsMap["etcd-servers"] = cfg.StorageEndpoint argsMap["etcd-servers"] = cfg.StorageEndpoint
} }
if cfg.StorageBackend != "etcd3" {
argsMap["watch-cache"] = "false"
}
certDir := filepath.Join(cfg.DataDir, "tls/temporary-certs") certDir := filepath.Join(cfg.DataDir, "tls/temporary-certs")
os.MkdirAll(certDir, 0700) 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["cert-dir"] = certDir
argsMap["allow-privileged"] = "true" argsMap["allow-privileged"] = "true"
argsMap["authorization-mode"] = strings.Join([]string{modes.ModeNode, modes.ModeRBAC}, ",") argsMap["authorization-mode"] = strings.Join([]string{modes.ModeNode, modes.ModeRBAC}, ",")