Skip to content

Commit

Permalink
Merge pull request #996 from msherif1234/bz_2052975-4.9
Browse files Browse the repository at this point in the history
Bug 2063835: backport 2052975 to 4.9
  • Loading branch information
openshift-merge-robot authored Mar 24, 2022
2 parents 8699d75 + e404618 commit af4feef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN yum install -y \
yum clean all

ARG ovsver=2.16.0-15.el8fdp
ARG ovnver=21.12.0-25.el8fdp
ARG ovnver=21.12.0-32.el8fdp

RUN INSTALL_PKGS=" \
openssl python3-pyOpenSSL firewalld-filesystem \
Expand All @@ -45,7 +45,7 @@ RUN INSTALL_PKGS=" \
" && \
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False "openvswitch2.16 = $ovsver" "openvswitch2.16-devel = $ovsver" "python3-openvswitch2.16 = $ovsver" "openvswitch2.16-ipsec = $ovsver" && \
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False "ovn21.12 = $ovnver" "ovn21.12-central = $ovnver" "ovn21.12-host = $ovnver" "ovn21.12-vtep = $ovnver" && \
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False "ovn-2021 = $ovnver" "ovn-2021-central = $ovnver" "ovn-2021-host = $ovnver" "ovn-2021-vtep = $ovnver" && \
yum clean all && rm -rf /var/cache/*

RUN mkdir -p /var/run/openvswitch && \
Expand Down
2 changes: 2 additions & 0 deletions go-controller/pkg/ovn/egressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ func (oc *Controller) addEgressNode(egressNode *kapi.Node) error {
"logical_switch_port",
types.EXTSwitchToGWRouterPrefix+types.GWRouterPrefix+egressNode.Name,
"options:nat-addresses=router",
"options:exclude-lb-vips-from-garp=true",
); err != nil {
klog.Errorf("Unable to configure GARP on external logical switch port for egress node: %s, "+
"this will result in packet drops during egress IP re-assignment, stdout: %s, stderr: %s, err: %v", egressNode.Name, stdout, stderr, err)
Expand Down Expand Up @@ -665,6 +666,7 @@ func (oc *Controller) deleteEgressNode(egressNode *kapi.Node) error {
types.EXTSwitchToGWRouterPrefix+types.GWRouterPrefix+egressNode.Name,
"options",
"nat-addresses=router",
"exclude-lb-vips-from-garp=true",
); err != nil {
klog.Errorf("Unable to remove GARP configuration on external logical switch port for egress node: %s, stdout: %s, stderr: %s, err: %v", egressNode.Name, stdout, stderr, err)
}
Expand Down
46 changes: 23 additions & 23 deletions go-controller/pkg/ovn/egressip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=_uuid find logical_router_policy priority=%s nexthop!=[]", types.EgressIPReroutePriority),
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -288,8 +288,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router exclude-lb-vips-from-garp=true"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -407,7 +407,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=_uuid find logical_router_policy priority=%s nexthop!=[]", types.EgressIPReroutePriority),
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -444,8 +444,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router exclude-lb-vips-from-garp=true"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1337,8 +1337,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1521,7 +1521,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1617,8 +1617,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=_uuid find logical_router_policy priority=%s nexthop!=[]", types.EgressIPReroutePriority),
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1714,7 +1714,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=_uuid find logical_router_policy priority=%s nexthop!=[]", types.EgressIPReroutePriority),
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1742,7 +1742,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
}
fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)
_, err := fakeOvn.fakeClient.KubeClient.CoreV1().Nodes().Update(context.TODO(), &node2, metav1.UpdateOptions{})
Expand Down Expand Up @@ -1846,7 +1846,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -1980,7 +1980,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_%s options:nat-addresses=router", node1.Name),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_%s options:nat-addresses=router options:exclude-lb-vips-from-garp=true", node1.Name),
},
)
fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
Expand Down Expand Up @@ -2133,7 +2133,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand All @@ -2151,7 +2151,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -2260,7 +2260,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand All @@ -2280,7 +2280,7 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -2367,8 +2367,8 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=_uuid find logical_router_policy priority=%s nexthop!=[]", types.EgressIPReroutePriority),
fmt.Sprintf("ovn-nbctl --timeout=15 --may-exist lr-policy-add ovn_cluster_router 101 ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14 allow"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node1 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
fmt.Sprintf("ovn-nbctl --timeout=15 set logical_switch_port etor-GR_node2 options:nat-addresses=router options:exclude-lb-vips-from-garp=true"),
},
)

Expand Down Expand Up @@ -2403,13 +2403,13 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations", func() {

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router exclude-lb-vips-from-garp=true"),
},
)

fakeOvn.fakeExec.AddFakeCmdsNoOutputNoError(
[]string{
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router"),
fmt.Sprintf("ovn-nbctl --timeout=15 remove logical_switch_port etor-GR_node1 options nat-addresses=router exclude-lb-vips-from-garp=true"),
},
)

Expand Down

0 comments on commit af4feef

Please sign in to comment.