-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Chef 12 Bootstrap context changes break knife-windows bootstrap context #2565
Comments
Offhand that looks like legitimate x.0.0 API breakage, and knife-windows should be patched. Conditionally declaring different arity of a initializer in the subclass is a bit whack though. I'm sure you can do it, but now that I think about it, it might almost be easier to turn the 4th argument into an accessor that gets set on the object instead of passed into the initializer. Messy either way. |
I received the same error, so I Installed the Chef Dk, install the build essential, and after that I dowloaded the knife windows, and now I`m working fine knife bootstrap windows |
We need to investigate if we have bootstrap issues with knife-windows. If yes fixing this in knife-windows will make sense. Otherwise we can investigate restoring the constructor arity. |
The secret settings can come from the command line or the config file. It didn't seem right for the BootstrapContext to have the capability to parse the command line, so thats why I started passing it into the constructor. If we need to say that was a bad decision, I am fine with that 😄 |
Well, I think that's a fine decision, I just don't know what the best way to go about subclassing that when the superclass might be either the 3-arg 11 version of 4-arg 12 version. Maybe if we add an optional 4th arg to the knife-windows code ruby will be smart enough to work it out? |
Fixed by #2573. We still need to investigate:
|
So knife-windows has a class that inherits from
Chef::Knife::Core::BootstrapContext
, which I believe is a legitimate thing to do. The initializer for that class used to take 3 parameters in Chef 11, now it takes 4. Since Chef 12 just showed up in omnitruck, this breaks knife-windows tests on Chef 12 (which you get if you're using Ruby 2.0):https://github.com/opscode/chef/blob/master/lib/chef/knife/core/bootstrap_context.rb#L33
I think an easy fix might be to add a default value for the last parameter (
secret
). We can work around in knife-windows -- so far I only see a break in rspec, the actual bootstrap seems to work fine, unless it's somehow using Chef 11 in real world cases.The text was updated successfully, but these errors were encountered: