npc: Get rid of the legacy netpol

This commit is contained in:
Martynas Pumputis authored and Martynas Pumputis committed 2018-07-24 10:06:55 +02:00
1 parent cf3a3be8f2
commit 07d31a8558
10 files changed
+111 -341

No files matched your search

+7 -10
View File
@@ -216,7 +216,6 @@ type BridgeConfig struct {
NoBridgedFastdp bool
AWSVPC bool
NPC bool
LegacyNPC bool
MTU int
Mac string
Port int
@@ -462,16 +461,14 @@ func configureIPTables(config *BridgeConfig, ips ipset.Interface) error {
// Ignore error because chains might already exist
// TODO(brb): use constants for WEAVE-NPC* chains
_ = ipt.NewChain("filter", "WEAVE-NPC")
if !config.LegacyNPC {
_ = ipt.NewChain("filter", "WEAVE-NPC-EGRESS")
if err = ipt.AppendUnique("filter", "INPUT", "-i", config.WeaveBridgeName, "-j", "WEAVE-NPC-EGRESS"); err != nil {
return err
}
fwdRules = append(fwdRules, []string{
"-i", config.WeaveBridgeName,
"-m", "comment", "--comment", "NOTE: this must go before '-j KUBE-FORWARD'",
"-j", "WEAVE-NPC-EGRESS"})
_ = ipt.NewChain("filter", "WEAVE-NPC-EGRESS")
if err = ipt.AppendUnique("filter", "INPUT", "-i", config.WeaveBridgeName, "-j", "WEAVE-NPC-EGRESS"); err != nil {
return err
}
fwdRules = append(fwdRules, []string{
"-i", config.WeaveBridgeName,
"-m", "comment", "--comment", "NOTE: this must go before '-j KUBE-FORWARD'",
"-j", "WEAVE-NPC-EGRESS"})
// If WEAVE-NPC chain doesn't exist then creating a rule in the chain will fail
fwdRules = append(fwdRules,