2018-05-03 19:50:45 +00:00
|
|
|
package consul
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/consul/agent/consul/state"
|
|
|
|
"github.com/hashicorp/consul/agent/structs"
|
|
|
|
)
|
|
|
|
|
|
|
|
// consulCADelegate providers callbacks for the Consul CA provider
|
|
|
|
// to use the state store for its operations.
|
|
|
|
type consulCADelegate struct {
|
|
|
|
srv *Server
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *consulCADelegate) State() *state.Store {
|
|
|
|
return c.srv.fsm.State()
|
|
|
|
}
|
|
|
|
|
2020-01-09 15:32:19 +00:00
|
|
|
func (c *consulCADelegate) ApplyCARequest(req *structs.CARequest) (interface{}, error) {
|
2021-04-08 22:58:15 +00:00
|
|
|
return c.srv.raftApply(structs.ConnectCARequestType, req)
|
2018-05-03 19:50:45 +00:00
|
|
|
}
|