Skip to content

Commit

Permalink
Merge pull request #523 from squeed/backport-2152
Browse files Browse the repository at this point in the history
Bug 1956980: [release-4.7] fix ForEachAddressSet() as it is not calling the callback functions
  • Loading branch information
openshift-merge-robot committed May 28, 2021
2 parents 05f4165 + b9ba1fc commit 1113085
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 1 addition & 5 deletions go-controller/pkg/ovn/address_set/address_set.go
Expand Up @@ -83,11 +83,7 @@ func (asf *ovnAddressSetFactory) ForEachAddressSet(iteratorFn AddressSetIterFunc

processedAddressSets := sets.String{}
for _, line := range strings.Split(output, "\n") {
parts := strings.Split(line, ",")
if len(parts) != 2 {
continue
}
for _, externalID := range strings.Fields(parts[1]) {
for _, externalID := range strings.Split(line, ",") {
if !strings.HasPrefix(externalID, "name=") {
continue
}
Expand Down
8 changes: 6 additions & 2 deletions go-controller/pkg/ovn/address_set/address_set_test.go
Expand Up @@ -74,9 +74,13 @@ var _ = Describe("OVN Address Set operations", func() {
}

var namespacesRes string
for _, n := range namespaces {
for i, n := range namespaces {
name := n.makeName()
namespacesRes += fmt.Sprintf("%s,name=%s\n", hashedAddressSet(name), name)
if i%2 == 0 {
namespacesRes += fmt.Sprintf("keyA=valA,name=%s\n", name)
} else {
namespacesRes += fmt.Sprintf("name=%s,keyB=valB\n", name)
}
}
fexec.AddFakeCmd(&ovntest.ExpectedCmd{
Cmd: "ovn-nbctl --timeout=15 --format=csv --data=bare --no-heading --columns=external_ids find address_set",
Expand Down

0 comments on commit 1113085

Please sign in to comment.