Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reelase-4.11] OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd) #1259

Merged
merged 2 commits into from Sep 16, 2022

Conversation

tssurya
Copy link
Contributor

@tssurya tssurya commented Aug 31, 2022

Minor conflict in commit 1 on the e2e file since e1f7da0 is missing in 4.11

This PR does two things:

1) Loops through all the ACLs that have `ARPallowPolicy`
in their names and have " && arp" in their match expression
and deletes it. This is because we did
https://github.com/openshift/ovn-kubernetes/pull/1043/files where
we changed the match but didn't remove acls on the older match which
causes problems like:

2022-06-01T08:17:44.635401164Z E0601 08:17:44.634509       1 ovn.go:753]
Failed to create network policy mdh-old/allow-from-other-namespaces,
error: failed to create default port groups and acls for policy:
mdh-old/allow-from-other-namespaces, error: unexpectedly found multiple
equivalent ACLs: [{UUID:3bc36c0e-ee1a-4609-a240-c211f14f379b
Action:allow Direction:to-lport
ExternalIDs:map[default-deny-policy-type:Ingress] Label:0 Log:false
Match:outport == @a13985064446031893020_ingressDefaultDeny && arp
Meter:0xc003245210 Name:0xc003245220 Options:map[] Priority:1001
Severity:0xc003245230} {UUID:41702278-fb49-4418-abca-6425912d1e63
Action:allow Direction:to-lport
ExternalIDs:map[default-deny-policy-type:Ingress] Label:0 Log:false
Match:outport == @a13985064446031893020_ingressDefaultDeny && (arp ||
nd) Meter:0xc0032452a0 Name:0xc0032452b0 Options:map[] Priority:1001
Severity:0xc0032452c0}]

on upgrades

2) When we create the default deny ACLs for a namespace with at least
one network policy, we name it "namespace_np-name". This doesn't make
sense since the ACL is applicable to all the network policies in that
namespace. The policy that get's created first becomes the lucky winner.
This PR updates the names of default deny ACLs to
"namespace_egressDefaultDeny" OR "namespace_ingressDefaultDeny" so that
"we can stop being stupid" :) and stop errors like:

2022-06-09T17:15:00.952174381Z E0609 17:15:00.952154       1 ovn.go:753]
Failed to create network policy oit-ssi-fluentd/fluentd-input, error:
failed to create default port groups and acls for policy:
oit-ssi-fluentd/fluentd-input, error: unexpectedly found multiple
equivalent ACLs: [{UUID:5b98f17d-789f-4de1-9beb-36741bfa40d1 Action:drop
Direction:from-lport ExternalIDs:map[default-deny-policy-type:Egress]
Label:0 Log:false Match:inport ==
@a12933912868060780448_egressDefaultDeny Meter:0xc001388aa0
Name:0xc001388ab0 Options:map[apply-after-lb:true] Priority:1000
Severity:0xc001388ac0} {UUID:b9349cb8-99b0-4130-92cf-ab11b4874a11
Action:drop Direction:from-lport
ExternalIDs:map[default-deny-policy-type:Egress] Label:0 Log:false
Match:inport == @a12933912868060780448_egressDefaultDeny
Meter:0xc001388c90 Name:0xc001388ca0 Options:map[apply-after-lb:true]
Priority:1000 Severity:0xc001388cb0}]

(NOTE: not sure how the user ended up with two default ACLs in the same
namespace, but they did!)

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
(cherry picked from commit 5fea420)

Conflicts in 4.11:
  test/e2e/acl_logging.go had minor conflicts since
openshift@e1f7da0
 is missing in 4.11
We weren't removing reference of ACL from PG before deleting
it. Unfortuntely unit tests don't catch this.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
(cherry picked from commit 4d446ba)
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 31, 2022

@tssurya: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

OCPBUGS 772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tssurya
Copy link
Contributor Author

tssurya commented Aug 31, 2022

/jira refresh

@tssurya tssurya changed the title OCPBUGS 772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd) OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd) Aug 31, 2022
@openshift-ci-robot openshift-ci-robot added the jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. label Aug 31, 2022
@openshift-ci-robot
Copy link
Contributor

@tssurya: This pull request references Jira Issue OCPBUGS-772, which is invalid:

  • expected Jira Issue OCPBUGS-772 to depend on a bug targeting a version in 4.12.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Minor conflict in commit 1 on the e2e file since e1f7da0 is missing in 4.11

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 31, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 31, 2022

@tssurya: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tssurya
Copy link
Contributor Author

tssurya commented Aug 31, 2022

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Aug 31, 2022
@openshift-ci-robot
Copy link
Contributor

@tssurya: This pull request references Jira Issue OCPBUGS-772, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.11.z) matches configured target version for branch (4.11.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-771 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-771 targets the "4.12.0" version, which is one of the valid target versions: 4.12.0
  • bug has dependents

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 31, 2022
@tssurya
Copy link
Contributor Author

tssurya commented Aug 31, 2022

/cherry-pick release-4.10

@openshift-cherrypick-robot

@tssurya: once the present PR merges, I will cherry-pick it on top of release-4.10 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tssurya
Copy link
Contributor Author

tssurya commented Sep 1, 2022

/retest

@tssurya
Copy link
Contributor Author

tssurya commented Sep 1, 2022

hmm we might need openshift/origin#27312 to go into 4.11 as well

@tssurya
Copy link
Contributor Author

tssurya commented Sep 7, 2022

/retest

@tssurya tssurya changed the title OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd) [reelase-4.11] OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd) Sep 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 8, 2022

@tssurya: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

Retaining the bugzilla/valid-bug label as it was manually added.

In response to this:

[reelase-4.11] OCPBUGS-772: Fix NP upgrade bug: unexpectedly found multiple equivalent ACLs (arp v/s arp||nd)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tssurya
Copy link
Contributor Author

tssurya commented Sep 8, 2022

/retest

@npinaeva
Copy link
Member

npinaeva commented Sep 9, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2022
@tssurya
Copy link
Contributor Author

tssurya commented Sep 12, 2022

/retest-required

@trozet
Copy link
Contributor

trozet commented Sep 12, 2022

/approve
/label backport-risk-assessed

@openshift-ci openshift-ci bot added the ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯ label Sep 13, 2022
@tssurya
Copy link
Contributor Author

tssurya commented Sep 13, 2022

dumb bot listen to tim's approve...

@tssurya
Copy link
Contributor Author

tssurya commented Sep 13, 2022

/lgtm
in attempt to kick in the approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 13, 2022

@tssurya: you cannot LGTM your own PR.

In response to this:

/lgtm
in attempt to kick in the approve

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 13, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: npinaeva, trozet, tssurya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2022
@tssurya
Copy link
Contributor Author

tssurya commented Sep 13, 2022

@anuragthehatter : PTAL

@tssurya
Copy link
Contributor Author

tssurya commented Sep 13, 2022

/assign @anuragthehatter

@anuragthehatter
Copy link

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 15, 2022
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD b587ad6 and 2 for PR HEAD de6258c in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 16, 2022

@tssurya: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack-ovn de6258c link false /test e2e-openstack-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@tssurya
Copy link
Contributor Author

tssurya commented Sep 16, 2022

/test e2e-aws-ovn-upgrade

@openshift-merge-robot openshift-merge-robot merged commit d2b3afa into openshift:release-4.11 Sep 16, 2022
@openshift-ci-robot
Copy link
Contributor

@tssurya: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-772 has been moved to the MODIFIED state.

In response to this:

Minor conflict in commit 1 on the e2e file since e1f7da0 is missing in 4.11

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@tssurya: #1259 failed to apply on top of branch "release-4.10":

Applying: Update and cleanup older stale ACLs upon startup
Using index info to reconstruct a base tree...
M	go-controller/pkg/ovn/policy.go
M	go-controller/pkg/ovn/policy_test.go
Falling back to patching base and 3-way merge...
Auto-merging go-controller/pkg/ovn/policy_test.go
Auto-merging go-controller/pkg/ovn/policy.go
CONFLICT (content): Merge conflict in go-controller/pkg/ovn/policy.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Update and cleanup older stale ACLs upon startup
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

tssurya added a commit to tssurya/ovn-kubernetes that referenced this pull request Sep 26, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift/ovn-kubernetes#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patrk Diak <pdiak@redhat.com>
tssurya added a commit to tssurya/ovn-kubernetes that referenced this pull request Sep 26, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift/ovn-kubernetes#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
tssurya added a commit to tssurya/ovn-kubernetes that referenced this pull request Sep 27, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift/ovn-kubernetes#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Sep 27, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Sep 27, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Sep 27, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

NOTE: In 4.11
openshift@44ad754#diff-5b9331449265f93da0d6fac90800eb68b7cb28f72b3f55eb01ad7026fc2b6089R68
is missing so we are directly using libovsdbops.BuildACL.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Sep 27, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

NOTE: In 4.11
openshift@44ad754#diff-5b9331449265f93da0d6fac90800eb68b7cb28f72b3f55eb01ad7026fc2b6089R68
is missing so we are directly using libovsdbops.BuildACL.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Oct 7, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

NOTE: In 4.11
openshift@44ad754#diff-5b9331449265f93da0d6fac90800eb68b7cb28f72b3f55eb01ad7026fc2b6089R68
is missing so we are directly using libovsdbops.BuildACL.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Oct 11, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

NOTE: In 4.11
openshift@44ad754#diff-5b9331449265f93da0d6fac90800eb68b7cb28f72b3f55eb01ad7026fc2b6089R68
is missing so we are directly using libovsdbops.BuildACL.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
(cherry picked from commit a039f90)

Conflicts in 4.10:
	go-controller/pkg/ovn/policy.go
had to remove passing `ACL.options` into BuildACL because in 4.10
we have: openshift@9b723ec
versus in 4.11 we had: openshift@14bf1f2
So the function signature for libovsdbops.BuildACL has changed between
versions.
tssurya added a commit to tssurya/ovn-kubernetes-1 that referenced this pull request Nov 2, 2022
We didn't consider this tiny hack that we do
https://github.com/openshift/ovn-kubernetes/blob/44ad75466e486cce605e39513a3ecd9e0b306e7d/go-controller/pkg/libovsdbops/acl.go#L60
there when we wrote openshift#1259
and unit tests don't actually scream loudly for longer names.

Without this PR we break users who have namespace names
longer than 45 characters.

NOTE: In 4.11
openshift@44ad754#diff-5b9331449265f93da0d6fac90800eb68b7cb28f72b3f55eb01ad7026fc2b6089R68
is missing so we are directly using libovsdbops.BuildACL.

Signed-off-by: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-authored-by: Patryk Diak <pdiak@redhat.com>
(cherry picked from commit b10ed7b)
(cherry picked from commit 54381b0)
(cherry picked from commit a039f90)

Conflicts in 4.10:
	go-controller/pkg/ovn/policy.go
had to remove passing `ACL.options` into BuildACL because in 4.10
we have: openshift@9b723ec
versus in 4.11 we had: openshift@14bf1f2
So the function signature for libovsdbops.BuildACL has changed between
versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants