@@ -15,7 +15,6 @@ import (
15
15
"sync"
16
16
"time"
17
17
18
- "github.com/docker/docker/libnetwork/drivers/overlay/overlayutils"
19
18
"github.com/docker/docker/pkg/plugingetter"
20
19
"github.com/docker/go-metrics"
21
20
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
@@ -164,7 +163,6 @@ type Node struct {
164
163
manager * manager.Manager
165
164
notifyNodeChange chan * agent.NodeChanges // used by the agent to relay node updates from the dispatcher Session stream to (*Node).run
166
165
unlockKey []byte
167
- vxlanUDPPort uint32
168
166
}
169
167
170
168
type lastSeenRole struct {
@@ -274,8 +272,11 @@ func (n *Node) currentRole() api.NodeRole {
274
272
}
275
273
276
274
// configVXLANUDPPort sets vxlan port in libnetwork
277
- func configVXLANUDPPort (ctx context.Context , vxlanUDPPort uint32 ) {
278
- if err := overlayutils .ConfigVXLANUDPPort (vxlanUDPPort ); err != nil {
275
+ func (n * Node ) configVXLANUDPPort (ctx context.Context , vxlanUDPPort uint32 ) {
276
+ if n .config .NetworkProvider == nil {
277
+ return
278
+ }
279
+ if err := n .config .NetworkProvider .SetDefaultVXLANUDPPort (vxlanUDPPort ); err != nil {
279
280
log .G (ctx ).WithError (err ).Error ("failed to configure VXLAN UDP port" )
280
281
return
281
282
}
@@ -372,8 +373,7 @@ func (n *Node) run(ctx context.Context) (err error) {
372
373
case nodeChanges := <- n .notifyNodeChange :
373
374
if nodeChanges .Node != nil {
374
375
if nodeChanges .Node .VXLANUDPPort != 0 {
375
- n .vxlanUDPPort = nodeChanges .Node .VXLANUDPPort
376
- configVXLANUDPPort (ctx , n .vxlanUDPPort )
376
+ n .configVXLANUDPPort (ctx , nodeChanges .Node .VXLANUDPPort )
377
377
}
378
378
// This is a bit complex to be backward compatible with older CAs that
379
379
// don't support the Node.Role field. They only use what's presently
0 commit comments