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

Chef 12 Bootstrap context changes break knife-windows bootstrap context #2565

Closed
adamedx opened this issue Dec 8, 2014 · 6 comments
Closed
Labels
Platform: Windows Type: Bug Does not work as expected.
Milestone

Comments

@adamedx
Copy link
Contributor

adamedx commented Dec 8, 2014

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.

@lamont-granquist
Copy link
Contributor

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.

@rogerfdias
Copy link

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

@lamont-granquist lamont-granquist added this to the 12.0.1 milestone Dec 8, 2014
@sersut sersut added Bug labels Dec 8, 2014
@sersut
Copy link
Contributor

sersut commented Dec 8, 2014

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.

@tyler-ball
Copy link
Contributor

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 😄

@lamont-granquist
Copy link
Contributor

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?

@sersut
Copy link
Contributor

sersut commented Dec 9, 2014

Fixed by #2573.

We still need to investigate:

  • Chef 11 + knife-windows bootstrapping Chef Client 12 on the nodes.
  • knife-windows + Chef 12 can not transport trusted certificates to the nodes.

@sersut sersut closed this as completed Dec 9, 2014
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 25, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Windows Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

7 participants