Skip to content

Commit

Permalink
Update the delegate type
Browse files Browse the repository at this point in the history
  • Loading branch information
madhanrm committed Mar 7, 2018
1 parent 5f6aabf commit 2654f82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
9 changes: 5 additions & 4 deletions plugins/main/windows/l2bridge/l2bridge_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
type NetConf struct {
hns.NetConf

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

// NAT based on the the configured cluster network
// if n.IPMasq {
// n.ApplyOutboundNatPolicy(n.clusterNetworkPrefix.String())
// }
if n.ipmasq {
n.ApplyOutboundNatPolicy(n.clusterNetworkPrefix.String())
}

nameservers := strings.Join(n.DNS.Nameservers, ",")
if result.DNS.Nameservers != nil {
nameservers = strings.Join(result.DNS.Nameservers, ",")
Expand Down
7 changes: 7 additions & 0 deletions plugins/meta/flannel/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


windows: $(shell find . -type f -name '*.go')
GOOS=windows go build -o flannel.exe
clean:
rm -rf flannel.exe

4 changes: 2 additions & 2 deletions plugins/meta/flannel/flannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ func cmdAddWindows(containerID string, n *NetConf, fenv *subnetEnv) error {
n.Delegate["name"] = n.Name

if !hasKey(n.Delegate, "type") {
n.Delegate["type"] = "win-l2bridge"
n.Delegate["type"] = "l2bridge"
}

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

n.Delegate["cniVersion"] = "0.2.0"
Expand Down

0 comments on commit 2654f82

Please sign in to comment.