Skip to content

Commit 2654f82

Browse files
committed
Update the delegate type
1 parent 5f6aabf commit 2654f82

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

plugins/main/windows/l2bridge/l2bridge_windows.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
type NetConf struct {
3838
hns.NetConf
3939

40-
IPMasq bool `json:"ipmasq,omitempty"`
40+
ipmasq bool `json:"ipmasq,omitempty"`
4141
clusterNetworkPrefix net.IPNet `json:"clusterprefix,omitempty"`
4242
}
4343
type K8sCniEnvArgs struct {
@@ -122,9 +122,10 @@ func cmdAdd(args *skel.CmdArgs) error {
122122
gw[len(gw)-1] += 2
123123

124124
// NAT based on the the configured cluster network
125-
// if n.IPMasq {
126-
// n.ApplyOutboundNatPolicy(n.clusterNetworkPrefix.String())
127-
// }
125+
if n.ipmasq {
126+
n.ApplyOutboundNatPolicy(n.clusterNetworkPrefix.String())
127+
}
128+
128129
nameservers := strings.Join(n.DNS.Nameservers, ",")
129130
if result.DNS.Nameservers != nil {
130131
nameservers = strings.Join(result.DNS.Nameservers, ",")

plugins/meta/flannel/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
windows: $(shell find . -type f -name '*.go')
4+
GOOS=windows go build -o flannel.exe
5+
clean:
6+
rm -rf flannel.exe
7+

plugins/meta/flannel/flannel.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,12 @@ func cmdAddWindows(containerID string, n *NetConf, fenv *subnetEnv) error {
251251
n.Delegate["name"] = n.Name
252252

253253
if !hasKey(n.Delegate, "type") {
254-
n.Delegate["type"] = "win-l2bridge"
254+
n.Delegate["type"] = "l2bridge"
255255
}
256256

257257
// if flannel needs ipmasq - get the plugin to configure it
258258
// (this is the opposite of how linux works - on linux the flannel daemon configure ipmasq)
259-
n.Delegate["IPMasq"] = *fenv.ipmasq
259+
n.Delegate["ipmasq"] = *fenv.ipmasq
260260
n.Delegate["clusterNetworkPrefix"] = fenv.nw.String()
261261

262262
n.Delegate["cniVersion"] = "0.2.0"

0 commit comments

Comments
 (0)