Skip to content
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 additional flags for docker_network #523

Merged
merged 3 commits into from
Sep 20, 2019

Conversation

lemrouch
Copy link
Contributor

@lemrouch lemrouch commented Sep 3, 2019

I tried to create docker network with multiple additional parameters like:
docker_network { 'db_net'
..
additional_flags => '--scope swarm --attachable --internal --config-from db_net_config',
..
but Docker complained about uknown flag:

Error: Execution of '/usr/bin/docker network create --driver=macvlan --scope swarm --attachable --internal --config-from db_net_config db_net' returned 125: unknown flag: --scope swarm --attachable --internal --config-from db_net_config
See 'docker network create --help'.

While running the command by simple copy&paste worked just fine:

~# /usr/bin/docker network create --driver=macvlan --scope swarm --attachable --internal --config-from db_net_config db_net
ep37zquecbh4qp5ks06n1v244

Each additional flag has to be pushed as extra String otherwise
Docker will complain about uknown flag.

I don't know how to write tests but even clean repository fails bundle exec rake spec on Ubuntu 19.04 with:

Failures:

  1. create creates a docker network
    Failure/Error: expect(provider.create).to be_nil
 NoMethodError:
   undefined method `create' for nil:NilClass
 # ./spec/unit/lib/puppet/provider/docker_network_spec.rb:22:in `block (3 levels) in <top (required)>'

Each additional flag has to be pushed as extra String otherwise
Docker will complain about uknown flag.

Signed-off-by: Pavel Matěja <[email protected]>
Each additional flag has to be pushed as extra String otherwise
Docker will complain about uknown flag.

Signed-off-by: Pavel Matěja <[email protected]>
@sheenaajay
Copy link
Contributor

Thanks @lemrouch for submitting the PR. Could you please add the new flag name here.
https://github.com/puppetlabs/puppetlabs-docker/blob/9575cfde1cac752240e3c9b946c19f6c5c7302c5/spec/unit/lib/puppet/type/docker_network_spec.rb
Please let us know if you need more information. Thank you.

@sheenaajay sheenaajay merged commit 905f32b into puppetlabs:master Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants