Browse Source

Use ClusterID to check for readiness

The TrustDomain is populated from the Host() method which includes the
hard-coded "consul" domain. This means that despite having an empty
cluster ID, the TrustDomain won't be empty.
pull/11545/head
freddygv 3 years ago
parent
commit
da5bcc574e
  1. 6
      agent/consul/server_connect.go

6
agent/consul/server_connect.go

@ -29,12 +29,12 @@ func (s *Server) getCARoots(ws memdb.WatchSet, state *state.Store) (*structs.Ind
// defensive.
return nil, fmt.Errorf("no cluster trust domain setup")
}
indexedRoots.TrustDomain = signingID.Host()
if indexedRoots.TrustDomain == "" {
if signingID.ClusterID == "" {
return nil, fmt.Errorf("CA has not finished initializing")
}
indexedRoots.TrustDomain = signingID.Host()
indexedRoots.Index, indexedRoots.Roots = index, roots
if indexedRoots.Roots == nil {
indexedRoots.Roots = make(structs.CARoots, 0)

Loading…
Cancel
Save