Skip to content

Commit

Permalink
test: brokerpak helper to cope with v2 CSB (#1742)
Browse files Browse the repository at this point in the history
  • Loading branch information
blgm authored Apr 15, 2024
1 parent 4238903 commit 9c63d77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acceptance-tests/helpers/brokerpaks/brokerpaks.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ func readBrokerVersion(version string) string {
defer body.Close()
data := must(io.ReadAll(body))

matches := regexp.MustCompile(`(?m)^\s*github\.com/cloudfoundry/cloud-service-broker\s+(\S+)\s*$`).FindSubmatch(data)
if len(matches) != 2 {
matches := regexp.MustCompile(`(?m)^\s*github\.com/cloudfoundry/cloud-service-broker(/v\d+)?\s+(\S+)\s*$`).FindSubmatch(data)
if len(matches) != 3 {
panic(fmt.Sprintf("Could not extract CSB version from go.mod file: %q", data))
}

brokerVersion := string(matches[1])
brokerVersion := string(matches[2])
fmt.Printf("Brokerpak version %q uses broker version %q\n", version, brokerVersion)
return brokerVersion
}
Expand Down

0 comments on commit 9c63d77

Please sign in to comment.