From a4312d2e6e119e6fcf773f544ef528a4d78b9a99 Mon Sep 17 00:00:00 2001 From: tradel Date: Tue, 27 Aug 2019 14:11:40 -0700 Subject: [PATCH] add domain and nodeName to agent cert request --- agent/agent.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index 063b120eb8..68507253c8 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -536,7 +536,7 @@ func (a *Agent) setupClientAutoEncryptCache(reply *structs.SignedResponse) (*str QueryOptions: structs.QueryOptions{Token: a.tokens.AgentToken()}, } - // prepolutate roots cache + // prepopulate roots cache rootRes := cache.FetchResult{Value: &reply.ConnectCARoots, Index: reply.ConnectCARoots.QueryMeta.Index} if err := a.cache.Prepopulate(cachetype.ConnectCARootName, rootRes, a.config.Datacenter, a.tokens.AgentToken(), rootsReq.CacheInfo().Key); err != nil { return nil, nil, err @@ -546,9 +546,11 @@ func (a *Agent) setupClientAutoEncryptCache(reply *structs.SignedResponse) (*str Datacenter: a.config.Datacenter, Token: a.tokens.AgentToken(), Agent: a.config.NodeName, + Domain: a.config.DNSDomain, + NodeName: a.config.NodeName, } - // prepolutate leaf cache + // prepopulate leaf cache certRes := cache.FetchResult{Value: &reply.IssuedCert, Index: reply.ConnectCARoots.QueryMeta.Index} if err := a.cache.Prepopulate(cachetype.ConnectCALeafName, certRes, a.config.Datacenter, a.tokens.AgentToken(), leafReq.Key()); err != nil { return nil, nil, err