Skip to content

Commit

Permalink
Merge pull request #62 from getamis/fix-nil-config
Browse files Browse the repository at this point in the history
test: get port from inspected container
  • Loading branch information
markya0616 authored Dec 17, 2018
2 parents 79ff75b + bbb010b commit d3c3df4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func RunMigrationContainer(dbContainer *SQLContainer, options MigrationOptions)
// Override the sql host because the migration needs to connect to the
// sql server via the docker bridge network directly.
dbContainer.Options.Host = inspectedContainer.NetworkSettings.IPAddress
for k := range dbContainer.container.Config.ExposedPorts {
for k := range inspectedContainer.Config.ExposedPorts {
dbContainer.Options.Port = k.Port()
break
}
Expand Down Expand Up @@ -107,7 +107,7 @@ func RunGoMigrationContainer(dbContainer *SQLContainer, options MigrationOptions
// Override the sql host because the migration needs to connect to the
// sql server via the docker bridge network directly.
dbContainer.Options.Host = inspectedContainer.NetworkSettings.IPAddress
for k := range dbContainer.container.Config.ExposedPorts {
for k := range inspectedContainer.Config.ExposedPorts {
dbContainer.Options.Port = k.Port()
break
}
Expand Down

0 comments on commit d3c3df4

Please sign in to comment.