Skip to content

Commit

Permalink
Merge pull request ovn-kubernetes#896 from russellb/v6-address-quoting
Browse files Browse the repository at this point in the history
Ensure addresses are quoted for address set
  • Loading branch information
girishmg authored Nov 1, 2019
2 parents c1e0c31 + f921789 commit 4830aa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions go-controller/pkg/ovn/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (oc *Controller) setAddressSet(hashName string, addresses []string) {
return
}

ips := strings.Join(addresses, " ")
ips := `"` + strings.Join(addresses, `" "`) + `"`
_, stderr, err := util.RunOVNNbctl("set", "address_set",
hashName, fmt.Sprintf("addresses=%s", ips))
if err != nil {
Expand Down Expand Up @@ -104,7 +104,7 @@ func (oc *Controller) createAddressSet(name string, hashName string,
return
}

ips := strings.Join(addresses, " ")
ips := `"` + strings.Join(addresses, `" "`) + `"`

// An addressSet has already been created. Just set addresses.
if addressSet != "" {
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/ovn/namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (n namespace) delCmds(fexec *ovntest.FakeExec, namespace v1.Namespace) {
func (n namespace) addCmdsWithPods(fexec *ovntest.FakeExec, tP pod, namespace v1.Namespace) {
n.baseCmds(fexec, namespace)
fexec.AddFakeCmdsNoOutputNoError([]string{
fmt.Sprintf("ovn-nbctl --timeout=15 set address_set %s addresses=%s", hashedAddressSet(namespace.Name), tP.podIP),
fmt.Sprintf(`ovn-nbctl --timeout=15 set address_set %s addresses="%s"`, hashedAddressSet(namespace.Name), tP.podIP),
})
}

Expand Down

0 comments on commit 4830aa1

Please sign in to comment.