mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add network attachment methods to cluster provider
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
parent
d39893a9a0
commit
547c342c1b
2 changed files with 27 additions and 0 deletions
|
@ -1,5 +1,10 @@
|
|||
package cluster
|
||||
|
||||
import (
|
||||
"github.com/docker/engine-api/types/network"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Provider provides clustering config details
|
||||
type Provider interface {
|
||||
IsManager() bool
|
||||
|
@ -8,4 +13,8 @@ type Provider interface {
|
|||
GetAdvertiseAddress() string
|
||||
GetRemoteAddress() string
|
||||
ListenClusterEvents() <-chan struct{}
|
||||
AttachNetwork(string, string, []string) (*network.NetworkingConfig, error)
|
||||
DetachNetwork(string, string) error
|
||||
UpdateAttachment(string, string, *network.NetworkingConfig) error
|
||||
WaitForDetachment(context.Context, string, string, string) error
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"github.com/docker/engine-api/types/network"
|
||||
"github.com/docker/libnetwork"
|
||||
"github.com/docker/libnetwork/api"
|
||||
"github.com/docker/libnetwork/config"
|
||||
|
@ -34,6 +35,7 @@ import (
|
|||
"github.com/docker/libnetwork/options"
|
||||
"github.com/docker/libnetwork/types"
|
||||
"github.com/gorilla/mux"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -329,6 +331,22 @@ func (d *dnetConnection) ListenClusterEvents() <-chan struct{} {
|
|||
return d.configEvent
|
||||
}
|
||||
|
||||
func (d *dnetConnection) AttachNetwork(string, string, []string) (*network.NetworkingConfig, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (d *dnetConnection) DetachNetwork(string, string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *dnetConnection) UpdateAttachment(string, string, *network.NetworkingConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *dnetConnection) WaitForDetachment(context.Context, string, string, string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleSignals(controller libnetwork.NetworkController) {
|
||||
c := make(chan os.Signal, 1)
|
||||
signals := []os.Signal{os.Interrupt, syscall.SIGTERM, syscall.SIGQUIT}
|
||||
|
|
Loading…
Reference in a new issue