Skip to content

Commit de58b5d

Browse files
committed
node: inject network allocator Provider
Make whichever main package that instantiates the Node responsible for constructing and injecting the appropriate low-level network allocator Provider for the application. Signed-off-by: Cory Snider <[email protected]>
1 parent af16b77 commit de58b5d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

node/node.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"github.com/moby/swarmkit/v2/ioutils"
3030
"github.com/moby/swarmkit/v2/log"
3131
"github.com/moby/swarmkit/v2/manager"
32-
"github.com/moby/swarmkit/v2/manager/allocator/cnmallocator"
3332
"github.com/moby/swarmkit/v2/manager/allocator/networkallocator"
3433
"github.com/moby/swarmkit/v2/manager/encryption"
3534
"github.com/moby/swarmkit/v2/remotes"
@@ -107,6 +106,9 @@ type Config struct {
107106
// for connections to the remote API (including the raft service).
108107
AdvertiseRemoteAPI string
109108

109+
// NetworkProvider provides network allocation for the cluster
110+
NetworkProvider networkallocator.Provider
111+
110112
// NetworkConfig stores network related config for the cluster
111113
NetworkConfig *networkallocator.Config
112114

@@ -1016,7 +1018,7 @@ func (n *Node) runManager(ctx context.Context, securityConfig *ca.SecurityConfig
10161018
RootCAPaths: rootPaths,
10171019
FIPS: n.config.FIPS,
10181020
NetworkConfig: n.config.NetworkConfig,
1019-
NetworkProvider: cnmallocator.NewProvider(n.config.PluginGetter),
1021+
NetworkProvider: n.config.NetworkProvider,
10201022
})
10211023
if err != nil {
10221024
return false, err

0 commit comments

Comments
 (0)