Skip to content

Conversation

@rnorth
Copy link
Member

@rnorth rnorth commented Jun 22, 2020

Replaces #2250, fixes #2191

My comment on #2250:

The current implementation fails to limit the running services. My misunderstanding was thinking that it was failing to launch any containers which are in withServices but not in withScaledServices.

Actually that is and always has been fine, but we're getting services launched that we do no want.

e.g. with a docker-compose.yml file like:

redis:
  image: redis
db:
  image: orchardup/mysql
  environment:
    MYSQL_DATABASE: wordpress

and

    public DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
        .withServices("redis");

(taken from the test)

... we'd expect on redis to come up, but actually db is launched too.

The same goes for:

    public DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/compose-test.yml"))
        .withServices("redis") // with or without this line
        .withScaledService("redis", 2);

... we get 2 redis, plus one db that wasn't asked for.

We should absolutely fix this.

@rnorth rnorth added this to the next milestone Jun 24, 2020
@rnorth rnorth merged commit 53e02a5 into master Jun 24, 2020
@rnorth rnorth deleted the mnafshin-master branch June 24, 2020 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DockerComposeContainer not starting up specific services

4 participants