Move assertion to after config fetch

This commit is contained in:
freddygv 2021-11-10 10:50:08 -07:00
parent da5bcc574e
commit 400697507b
1 changed files with 1 additions and 4 deletions

View File

@ -16,7 +16,7 @@ func (s *Server) getCARoots(ws memdb.WatchSet, state *state.Store) (*structs.Ind
if err != nil {
return nil, err
}
if config == nil {
if config == nil || config.ClusterID == "" {
return nil, fmt.Errorf("CA has not finished initializing")
}
@ -29,9 +29,6 @@ func (s *Server) getCARoots(ws memdb.WatchSet, state *state.Store) (*structs.Ind
// defensive.
return nil, fmt.Errorf("no cluster trust domain setup")
}
if signingID.ClusterID == "" {
return nil, fmt.Errorf("CA has not finished initializing")
}
indexedRoots.TrustDomain = signingID.Host()