confi\gure providers with DC and domain

This commit is contained in:
tradel 2019-08-27 14:16:25 -07:00
parent 5ba28a6a7b
commit 1ff46f3f0a
2 changed files with 3 additions and 3 deletions

View File

@ -176,7 +176,7 @@ func (s *ConnectCA) ConfigurationSet(
if err != nil { if err != nil {
return fmt.Errorf("could not initialize provider: %v", err) return fmt.Errorf("could not initialize provider: %v", err)
} }
if err := newProvider.Configure(args.Config.ClusterID, true, args.Config.Config); err != nil { if err := newProvider.Configure(args.Config.ClusterID, s.srv.config.Datacenter, s.srv.config.Domain, true, args.Config.Config); err != nil {
return fmt.Errorf("error configuring provider: %v", err) return fmt.Errorf("error configuring provider: %v", err)
} }
if err := newProvider.GenerateRoot(); err != nil { if err := newProvider.GenerateRoot(); err != nil {

View File

@ -197,7 +197,7 @@ func (s *Server) initializeCA() error {
// initializeRootCA runs the initialization logic for a root CA. // initializeRootCA runs the initialization logic for a root CA.
func (s *Server) initializeRootCA(provider ca.Provider, conf *structs.CAConfiguration) error { func (s *Server) initializeRootCA(provider ca.Provider, conf *structs.CAConfiguration) error {
if err := provider.Configure(conf.ClusterID, true, conf.Config); err != nil { if err := provider.Configure(conf.ClusterID, s.config.Datacenter, s.config.Domain, true, conf.Config); err != nil {
return fmt.Errorf("error configuring provider: %v", err) return fmt.Errorf("error configuring provider: %v", err)
} }
if err := provider.GenerateRoot(); err != nil { if err := provider.GenerateRoot(); err != nil {
@ -750,7 +750,7 @@ func (s *Server) initializeSecondaryProvider(provider ca.Provider, roots structs
return err return err
} }
if err := provider.Configure(clusterID, false, conf.Config); err != nil { if err := provider.Configure(clusterID, s.config.Datacenter, s.config.Domain, false, conf.Config); err != nil {
return fmt.Errorf("error configuring provider: %v", err) return fmt.Errorf("error configuring provider: %v", err)
} }