-
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
deep merge machine options, #455 #457
base: master
Are you sure you want to change the base?
deep merge machine options, #455 #457
Conversation
bootstrap_options merge failure in chef-boneyard#455
Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog. GitHub Users Who Are Not Authorized To ContributeThe following GitHub users do not appear to have signed a CLA: |
Hi. Your friendly Curry bot here. Just letting you know that all commit authors have become authorized to contribute. I have added the "Signed CLA" label to this issue so it can easily be found in the future. |
mm, this doesn't quite work -
Boption_three didn't get replaced....so back to the merge drawing board tomorrow. |
ok, there we go, now it's merging in the right direction:
|
tests should probably be updated to validate this, but I dont even know where to begin on this. :) |
@keen99 You should not use |
er...if we shouldn't use it, why is it there? (it being the and without it, how do I override my "global" option state for a specific for example, normally I create a t2.micro by default, but want to create a On Tue, Oct 6, 2015 at 4:36 PM, Tyler Ball [email protected] wrote:
|
this pattern is certainly mentioned in #383 - the problem is that the existing version doesn't support a deep merge, so bootstrap_options is just replaced (or worse, blows up in many variations) |
@keen99 The reason so many people use this is because the This is my vision for the future:
There isn't a huge gap between the present and this vision. I think #1 is already done, but this needs testing. People can stop using machine "my_machine" do
machine_options Cheffish::MergedConfig.new({...}, run_context.chef_provisioning.current_machine_options) So I think the correct fix, instead of this PR, is to fix the problem with the |
fixing MergedConfig is probably outside of my time and scope to tackle but your vision plan seems like it would introduce breaking and non-obvious
personally I only find current state -
confusing simply because the two add_'s dont behave the same way. I on 1) -
does what logic would expect - the second machine gets the second set. all that said - I'm far from being a developer. at best I'm a poor hack. On Tue, Oct 6, 2015 at 6:08 PM, Tyler Ball [email protected] wrote:
|
I'll definite say, though, that as a chef user, having to do this:
is a complete non-starter - a) as we've discovered cheffish::mergedconfig doesn't actually do a deep merge, and b) that's just not something a normal user should be doing! that's pure hackery in my book. I might -choose- to do it, but I'd never suggest it to a user as a correct solution. :( |
@tyler-ball I and others in my company have been using |
I also agree about breaking changes - what I proposed would only be done in a major version release, with documentation explaining the break and necessary migration steps. |
use deep merge for machine() add_machine_options, addresses bootstrap_options merge failure in #455