Move ConsulCAProviderConfig into structs package
This commit is contained in:
parent
887cc98d7e
commit
02fef5f9a2
|
@ -19,14 +19,8 @@ import (
|
|||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
type ConsulCAProviderConfig struct {
|
||||
PrivateKey string
|
||||
RootCert string
|
||||
RotationPeriod time.Duration
|
||||
}
|
||||
|
||||
type ConsulCAProvider struct {
|
||||
config *ConsulCAProviderConfig
|
||||
config *structs.ConsulCAProviderConfig
|
||||
|
||||
id string
|
||||
srv *Server
|
||||
|
@ -122,8 +116,8 @@ func NewConsulCAProvider(rawConfig map[string]interface{}, srv *Server) (*Consul
|
|||
return provider, nil
|
||||
}
|
||||
|
||||
func decodeConfig(raw map[string]interface{}) (*ConsulCAProviderConfig, error) {
|
||||
var config *ConsulCAProviderConfig
|
||||
func decodeConfig(raw map[string]interface{}) (*structs.ConsulCAProviderConfig, error) {
|
||||
var config *structs.ConsulCAProviderConfig
|
||||
if err := mapstructure.WeakDecode(raw, &config); err != nil {
|
||||
return nil, fmt.Errorf("error decoding config: %s", err)
|
||||
}
|
||||
|
|
|
@ -28,7 +28,5 @@ func TestCAProvider_Bootstrap(t *testing.T) {
|
|||
state := s1.fsm.State()
|
||||
_, activeRoot, err := state.CARootActive(nil)
|
||||
assert.NoError(err)
|
||||
assert.Equal(root.ID, activeRoot.ID)
|
||||
assert.Equal(root.Name, activeRoot.Name)
|
||||
assert.Equal(root.RootCert, activeRoot.RootCert)
|
||||
assert.Equal(root, activeRoot.RootCert)
|
||||
}
|
||||
|
|
|
@ -160,6 +160,12 @@ type CAConfiguration struct {
|
|||
RaftIndex
|
||||
}
|
||||
|
||||
type ConsulCAProviderConfig struct {
|
||||
PrivateKey string
|
||||
RootCert string
|
||||
RotationPeriod time.Duration
|
||||
}
|
||||
|
||||
// CAConsulProviderState is used to track the built-in Consul CA provider's state.
|
||||
type CAConsulProviderState struct {
|
||||
ID string
|
||||
|
|
Loading…
Reference in New Issue