-
Notifications
You must be signed in to change notification settings - Fork 163
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
expose machine_spec.from_image to allocate_machine #366
Conversation
Wow! It looks like no driver supports creating a machine with How about we set this on new_machine_options? |
I don't think |
The Just to clarify, the motivation behind this PR is another PR I have for chef-provisioning-docker - chef-boneyard/chef-provisioning-docker#56. That driver does make use of I think ideally, it would be nice to expose a reference to the actual machine resource to the driver calls but that certainly seems out of scope here. You can get that reference now from the I just moved the bulk of the |
@jkeiser It seems like you are saying: if the machine hasn't converged yet and we add the @mwrock In driver.rb you don't have access to |
Yeah, the spec shouldn't have desired state in it--it's not supposed to. machine_options is desired, machine_spec is current. The Driver methods can use the spec to find out the current state, or to update the current state after changes, but it feels like we shouldn't mix its purpose. Can machine_options do what we need here? Maybe a standard machine_option that gets set based on from_image? |
ok. So maybe To @tyler-ball 's point, one does have access to
I was hoping to make the retrieval of |
My apologies for falling off that call so abruptly. As we were talking about this it occured to me that I likely misunderstood @jkeiser 's initial comment to this PR above when he juggested moving this logic to |
Yep! I'm sorry I've been so scarce, I'm on an incredibly intensive vacation right now, not lots of opportunities to come up for air. |
No worries @jkeiser. I have updated my PR leaving the |
Hey @mwrock - I'm going to accept this PR now. It took 3 of us about 30 minutes to figure out what was going on here, but I think I got it. Let me summarize: In your docker PR you need access to the The only question in my mind is whether we include the So I'm going to accept this PR as-is! Thanks for your patience on this one. |
expose machine_spec.from_image to allocate_machine
You are correct @tyler-ball. Makes more sense to me to keep it at the top level. Thanks for merging! |
expose machine_spec.from_image to allocate_machine
expose machine_spec.from_image to allocate_machine
Currently
from_image
is added to themachine_spec
immediately afterallocate_machine
. I'm not sure if that was by design. I can think of scenarios where one would want to know if the machine is being created from an image from allocate_machine. This is possible using this hack:This feels a bit evil.
This PR sets the
machine_spec.from_image
in themachine
load_current_resource
which also allows the value to be set just once instead of both themachine
andmachine_batch
resources.