1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/vendor/github.com/docker/swarmkit/manager/controlapi/server.go
Liron Levin 7d45cafd57 pluggable secret backend
This commit extends SwarmKit secret management with pluggable secret
backends support.

Updating the work in
[swarmkit](docker/swarmkit@eebac27434) for
pluggable secret backend and adding the
driver parameter to `SecretSpec`.

Remaining work:
- [ ] CLI support (docker/cli)
- [ ] api in [plugin helpers](docker/go-plugins-helpers))
- [ ] Reference plugin
- [ ] Documenation (after cli work)

Signed-off-by: Liron Levin <liron@twistlock.com>
2017-07-15 16:50:02 +03:00

35 lines
891 B
Go

package controlapi
import (
"errors"
"github.com/docker/docker/pkg/plugingetter"
"github.com/docker/swarmkit/ca"
"github.com/docker/swarmkit/manager/state/raft"
"github.com/docker/swarmkit/manager/state/store"
)
var (
errInvalidArgument = errors.New("invalid argument")
)
// Server is the Cluster API gRPC server.
type Server struct {
store *store.MemoryStore
raft *raft.Node
securityConfig *ca.SecurityConfig
scu ca.APISecurityConfigUpdater
pg plugingetter.PluginGetter
}
// NewServer creates a Cluster API server.
func NewServer(store *store.MemoryStore, raft *raft.Node, securityConfig *ca.SecurityConfig,
scu ca.APISecurityConfigUpdater, pg plugingetter.PluginGetter) *Server {
return &Server{
store: store,
raft: raft,
securityConfig: securityConfig,
scu: scu,
pg: pg,
}
}