Skip to content

Commit

Permalink
fix: don't force linux/amd64 for mysql containers (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr authored Apr 30, 2024
1 parent e825b14 commit 2936c64
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sqlcon/dockertest/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ type dockerPool interface {
RunWithOptions(opts *dockertest.RunOptions, hcOpts ...func(*dc.HostConfig)) (*dockertest.Resource, error)
}

var resources = []*dockertest.Resource{}
var pool dockerPool
var (
resources = []*dockertest.Resource{}
pool dockerPool
)

func getPool() (dockerPool, error) {
if pool != nil {
Expand Down Expand Up @@ -240,7 +242,6 @@ func startMySQL(version string) (*dockertest.Resource, error) {
}

resource, err := pool.RunWithOptions(&dockertest.RunOptions{
Platform: "linux/amd64",
Repository: "mysql",
Tag: stringsx.Coalesce(version, "8.0.26"),
Env: []string{
Expand All @@ -267,7 +268,7 @@ func runMySQLCleanup(version string) (string, func(), error) {
return "", func() {}, err
}

return fmt.Sprintf("mysql://root:secret@(localhost:%s)/mysql?parseTime=true&multiStatements=true", resource.GetPort("3306/tcp")),
return fmt.Sprintf("mysql://root:secret@tcp(localhost:%s)/mysql?parseTime=true&multiStatements=true", resource.GetPort("3306/tcp")),
func() { _ = pool.Purge(resource) }, nil
}

Expand Down

0 comments on commit 2936c64

Please sign in to comment.