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 up name attribute to prevent multiple uses of same resource #14

Closed
computerlyrik opened this issue Sep 25, 2013 · 2 comments
Closed

Comments

@computerlyrik
Copy link
Contributor

I am not sure if i am getting this right....i am new to docker and this cookbook.

I think chef warns about declaring a same-name resource more than once.

If i think about my (future) configuration:

docker_container "some_image" do
command "/run/my/service1"
action :start
end

docker_container "some_image" do
command "/run/my/service2"
action :start
end

chef will send a warning.

Proposal: use the hostname for name_attribute.

@bflad
Copy link
Contributor

bflad commented Oct 5, 2013

That's correct, Chef will warn about using the same resource multiple times. Nicely, it does still work by copying attributes to the second instance, although there's an open ticket CHEF-3694 to possibly remove the functionality.

For now, things work as expected. Example:
https://github.com/bflad/chef-docker/blob/master/test/cookbooks/docker_test/recipes/container_lwrp.rb

I'm willing to discuss this more (bonus points for being able to come up with a workable solution), but also tempted to close this issue since its a what-if scenario in the Chef core that will have huge implications with many other cookbooks if Opscode changes the behavior.

@bflad
Copy link
Contributor

bflad commented Nov 11, 2013

Closing as a non-issue for now since cookbook still works until Opscode introduces the major change and I don't believe its a trivial fix. If anyone has ideas for fixing this, please reopen. Thanks!

@bflad bflad closed this as completed Nov 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants