mirror of https://github.com/status-im/consul.git
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.
This commit is contained in:
parent
aca0576cd1
commit
da5bcc574e
|
@ -29,12 +29,12 @@ func (s *Server) getCARoots(ws memdb.WatchSet, state *state.Store) (*structs.Ind
|
||||||
// defensive.
|
// defensive.
|
||||||
return nil, fmt.Errorf("no cluster trust domain setup")
|
return nil, fmt.Errorf("no cluster trust domain setup")
|
||||||
}
|
}
|
||||||
|
if signingID.ClusterID == "" {
|
||||||
indexedRoots.TrustDomain = signingID.Host()
|
|
||||||
if indexedRoots.TrustDomain == "" {
|
|
||||||
return nil, fmt.Errorf("CA has not finished initializing")
|
return nil, fmt.Errorf("CA has not finished initializing")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indexedRoots.TrustDomain = signingID.Host()
|
||||||
|
|
||||||
indexedRoots.Index, indexedRoots.Roots = index, roots
|
indexedRoots.Index, indexedRoots.Roots = index, roots
|
||||||
if indexedRoots.Roots == nil {
|
if indexedRoots.Roots == nil {
|
||||||
indexedRoots.Roots = make(structs.CARoots, 0)
|
indexedRoots.Roots = make(structs.CARoots, 0)
|
||||||
|
|
Loading…
Reference in New Issue