Skip to content

Commit

Permalink
Merge pull request #1096 from ksubrmnn/overlay
Browse files Browse the repository at this point in the history
 Enable host to local pod connectivity in Windows VXLAN
  • Loading branch information
Rajat Chopra authored Feb 15, 2019
2 parents c385913 + fc9cdb1 commit e4deb05
Show file tree
Hide file tree
Showing 642 changed files with 255,367 additions and 1,792 deletions.
26 changes: 25 additions & 1 deletion backend/vxlan/device_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"encoding/json"
"fmt"
"github.com/Microsoft/hcsshim"
"github.com/Microsoft/hcsshim/hcn"
"github.com/buger/jsonparser"
"github.com/coreos/flannel/pkg/ip"
log "github.com/golang/glog"
Expand Down Expand Up @@ -129,7 +130,30 @@ func ensureNetwork(expectedNetwork *hcsshim.HNSNetwork, expectedVSID int64, expe
}

log.Infof("Created HNSNetwork %s", networkName)
return newNetwork, nil
existingNetwork = newNetwork
}

existingNetworkV2, err := hcn.GetNetworkByID(existingNetwork.Id)
if err != nil {
return nil, errors.Annotatef(err, "Could not find vxlan0 in V2")
}

addHostRoute := true
for _, policy := range existingNetworkV2.Policies {
if policy.Type == hcn.HostRoute {
addHostRoute = false
}
}
if addHostRoute {
hostRoutePolicy := hcn.NetworkPolicy{
Type: hcn.HostRoute,
Settings: []byte("{}"),
}

networkRequest := hcn.PolicyNetworkRequest{
Policies: []hcn.NetworkPolicy{hostRoutePolicy},
}
existingNetworkV2.AddPolicy(networkRequest)
}

return existingNetwork, nil
Expand Down
5 changes: 5 additions & 0 deletions backend/vxlan/vxlan_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func (be *VXLANBackend) RegisterNetwork(ctx context.Context, wg sync.WaitGroup,
return nil, fmt.Errorf("Cannot get HNS networks [%+v]", err)
}

err = hcn.RemoteSubnetSupported()
if err != nil {
return nil, err
}

var remoteDrMac string
var providerAddress string
for _, hnsNetwork := range hnsNetworks {
Expand Down
2 changes: 1 addition & 1 deletion glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import:
- package: github.com/bronze1man/goStrongswanVici
version: 4d72634a2f113aa48347dbc7dcb14adb806b6534
- package: github.com/Microsoft/hcsshim
version: v0.8.3
- package: github.com/Microsoft/go-winio
version: v0.4.11
- pacakge: github.com/sirupsen/logrus
Expand Down
17 changes: 9 additions & 8 deletions vendor/github.com/Microsoft/hcsshim/appveyor.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions vendor/github.com/Microsoft/hcsshim/cmd/go-runhcs/NOTICE

This file was deleted.

125 changes: 0 additions & 125 deletions vendor/github.com/Microsoft/hcsshim/cmd/go-runhcs/runhcs.go

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e4deb05

Please sign in to comment.