-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple frontends with docker-compose --scale #3190
Fix multiple frontends with docker-compose --scale #3190
Conversation
09339fc
to
0c9ca7e
Compare
integration/docker_compose_test.go
Outdated
} | ||
|
||
func (s *DockerComposeSuite) SetUpSuite(c *check.C) { | ||
s.createComposeProject(c, "minimal") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.createComposeProject(c, composeProject)
integration/docker_compose_test.go
Outdated
|
||
func (s *DockerComposeSuite) TestComposeScale(c *check.C) { | ||
const serviceCount = 2 | ||
const composeService = "whoami1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use var
instead const
integration/docker_compose_test.go
Outdated
// check that we have only one backend with n servers | ||
c.Assert(provider.Backends, checker.HasLen, 1) | ||
myBackend := provider.Backends["backend-"+composeService+"-integrationtest"+composeProject] | ||
c.Assert(myBackend.Servers, checker.HasLen, serviceCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check if the backend exists before check if the server exists in the backend.
provider/docker/config.go
Outdated
|
||
serviceNameKey += segmentName | ||
|
||
return serviceNameKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return serviceNameKey + segmentName
integration/docker_compose_test.go
Outdated
// Docker test suites | ||
type DockerComposeSuite struct { | ||
BaseSuite | ||
project *docker.Project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unused.
} | ||
|
||
func (s *DockerComposeSuite) TestComposeScale(c *check.C) { | ||
var serviceCount = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, only one occurrence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Nice catch! 👏 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
27ce6c5
to
07a3f72
Compare
What does this PR do?
This PR update the docker provider to fix an issue with the docker compose scale.
Motivation
Fix #3145
More