Skip to content

Commit

Permalink
Fix failover test to work with bosh dns
Browse files Browse the repository at this point in the history
Signed-off-by: Swati Soni <[email protected]>
  • Loading branch information
jpalermo authored and pcf-core-services-writer committed Jul 18, 2018
1 parent 8885478 commit f1977c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cf-mysql-service/failover/failover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cloudfoundry-incubator/cf-test-helpers/generator"

"github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests/helpers"
"strings"
)

const (
Expand Down Expand Up @@ -100,9 +101,12 @@ func deleteMysqlVM(host string) error {

var vmcid string
for _, instance := range instances {
if instance.Group == "mysql" && instance.IPs[0] == host {
vmcid = instance.VMID
break
if instance.Group == "mysql" {
hostArray := strings.Split(host, ".")
if instance.IPs[0] == host || (len(hostArray) > 0 && hostArray[0] == instance.ID) {
vmcid = instance.VMID
break
}
}
}

Expand Down

0 comments on commit f1977c5

Please sign in to comment.