Add 'weave expose' NAT iptables rules inside CNI plugin

This avoids a race between the plugin and the script
This commit is contained in:
Bryan Boreham committed 2016-11-14 12:37:42 +00:00
1 parent 2b4d13c5b1
commit a07e3301b1
3 files changed
+21 -3

No files matched your search

+3
View File
@@ -84,6 +84,9 @@ func (c *CNIPlugin) CmdAdd(args *skel.CmdArgs) error {
if err := assignBridgeIP(conf.BrName, bridgeIPResult.IP4.IP); err != nil {
return fmt.Errorf("unable to assign IP address to bridge: %s", err)
}
if err := weavenet.ExposeNAT(bridgeIPResult.IP4.IP); err != nil {
return fmt.Errorf("unable to create NAT rules: %s", err)
}
bridgeIP = bridgeIPResult.IP4.IP.IP
} else if err != nil {
return err