Allow a worker to use KMS auth but accept PKI for proxy (#2206)

This essentially worked for non-dev mode before but would create storage
directories that weren't actually used or needed, and it didn't work in
dev mode because it made assumptions about the presence of a worker auth
kms or not. This fixes those behaviors.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-06-15 22:39:52 -04:00
1 parent 9a4545e59e
commit 32d04b9ce7
10 files changed
+58 -48

No files matched your search

@@ -84,7 +84,7 @@ func (w *Worker) controllerDialerFunc() func(context.Context, string) (net.Conn,
var conn net.Conn
var err error
switch {
case w.conf.WorkerAuthKms != nil:
case w.conf.WorkerAuthKms != nil && !w.conf.DevUsePkiForUpstream:
conn, err = w.v1KmsAuthDialFn(ctx, addr)
default:
conn, err = protocol.Dial(ctx, w.WorkerAuthStorage, addr, nodeenrollment.WithWrapper(w.conf.WorkerAuthStorageKms))