github.com/DerekStrickland/consul@v1.4.5/agent/consul/leader_oss.go (about) 1 // +build !ent 2 3 package consul 4 5 // initializeCA sets up the CA provider when gaining leadership, bootstrapping 6 // the root in the state store if necessary. 7 func (s *Server) initializeCA() error { 8 // Bail if connect isn't enabled. 9 if !s.config.ConnectEnabled { 10 return nil 11 } 12 13 conf, err := s.initializeCAConfig() 14 if err != nil { 15 return err 16 } 17 18 // Initialize the provider based on the current config. 19 provider, err := s.createCAProvider(conf) 20 if err != nil { 21 return err 22 } 23 24 return s.initializeRootCA(provider, conf) 25 } 26 27 // Stub methods, only present in Consul Enterprise. 28 func (s *Server) startEnterpriseLeader() {} 29 func (s *Server) stopEnterpriseLeader() {}