Skip to content
This repository has been archived by the owner on Jul 6, 2018. It is now read-only.

Added volumes support chef/chef-provisioning-docker#29 #33

Merged
merged 1 commit into from
May 5, 2015

Conversation

marc-
Copy link
Contributor

@marc- marc- commented Apr 3, 2015

Implements #29

Signed-off-by: Maksim Chizhov <maksim.chizhov@gmail.com>
@@ -227,6 +227,7 @@ def machine_for(machine_spec, machine_options, base_image_name)
:command => docker_options[:command],
:env => docker_options[:env],
:ports => [].push(docker_options[:ports]).flatten,
:volumes => [].push(docker_options[:volumes]).flatten.compact,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if docker_options[:volumes] isn't set? i.e. what if the user doesn't pass volumes--it feels like this will probably throw an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it fails for :ports => [].push(docker_options[:ports]).flatten, and I have PR for that too (please see #24). But invoking compact function makes it work, so volumes gets [] value instead of [null].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the syntax that looks like Array(docker_options[:volumes]) - this will perform the same function and is just smaller.

tyler-ball added a commit that referenced this pull request May 5, 2015
@tyler-ball tyler-ball merged commit 54d90f6 into chef-boneyard:master May 5, 2015
@tyler-ball
Copy link
Contributor

I had some minor comments, but nothing that would keep this from being merged. If you want to make the updates please open another PR!

@marc- marc- deleted the volumes branch May 6, 2015 09:16
@marc- marc- restored the volumes branch May 6, 2015 09:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants