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-3497] Fix knife configure order, apply any relevant Chef::Config[:knife] settings #583

Merged
merged 6 commits into from Jan 16, 2013

Conversation

danielsdeleo
Copy link
Contributor

This takes advantage of changes in mixlib-cli to keep default and user-supplied config values separate so that knife can automatically setup the config Hash by merging (in this order):

  1. mixlib-cli defaults
  2. Chef::Config[:knife]
  3. user-supplied cli options

This makes it drastically easier for knife plugins to "do the right thing" when it comes to setting options. Knife plugin authors should now:

  1. set the default value via the mixlib-cli DSL
  2. Fetch configurable values from the config Hash.

NOTE:

Before this can be merged, the new version of mixlib-cli needs to be released (currently available as an RC). To test, install the new version and run tests w/o bundler, or update your Gemfile locally.

chrisroberts and others added 5 commits January 11, 2013 16:04
Config changes a ton of global state and is based on the state of the
machine it runs on (most importantly, the user's config file). Running
configure_chef in the initializer makes unit tests extremely fragile
Takes advantage of new mixlib-cli option to keep default values from the
mixlib-cli DSL separate from user-supplied values. Config settings are
merged:
1. Defaults from mixlib-cli DSL
2. Settings from Chef::Config[:knife]
3. Values from CLI options
@danielsdeleo danielsdeleo merged commit 7ab98c4 into master Jan 16, 2013
@danielsdeleo danielsdeleo deleted the CHEF-3497 branch January 16, 2013 21:21
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants