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

Add multitenancy support to Chef client config and local mode #49

Merged
merged 3 commits into from Oct 16, 2014

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Sep 1, 2014

This adds multitenant chef-zero support to local mode by default, and adds options to make multitenancy and Hosted Chef much easier to develop for and work with.

@jkeiser
Copy link
Contributor Author

jkeiser commented Sep 2, 2014

Per implementation at chef/chef#1960 (PR does not do the repo_mode bit, but does everything else).

@jkeiser jkeiser force-pushed the jk/multitenant-chef-client-support branch from 9b64385 to 41ede76 Compare September 3, 2014 21:55
1. When `Chef::Config.organization` is set, `Chef::Config.chef_server_url` default to `https://api.opscode.com/organizations/#{organization}`

Multitenant root URL support:
1. A new configuration parameter, `Chef::Config.chef_server_root`, be added that points to the top of the server (above /organizations) where users and organization lists can be found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Having this as a core option will also help 3rd party tools. For example, I already use a config option by this name here:

https://github.com/opscode/knife-opc/blob/master/lib/chef/knife/opc_org_create.rb#L46

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be explicit about what the default value of chef_server_root will be? I am assuming that if chef_server_url is set then the default would be something like this:

chef_server_url.gsub(/\/organizations\/+[^\/]+\/*$/, '')

although for the RFC it is probably better to specify it via example than the above code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think it would be good to add api helpers for knife plugins that gives you access to a properly configured Chef::REST object for the root_url, much like the rest method currently provides for knife plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and done. @stevendanna I added the example in the RFC and added "rest_root" in the PR.

@adamhjk
Copy link
Contributor

adamhjk commented Sep 8, 2014

Lets bring this up at the next community meeting, and if there are no dissenting voices, merge it. 👍

@adamhjk
Copy link
Contributor

adamhjk commented Oct 15, 2014

👍 :shipit: @opscode/rfc-editors take it away

coderanger added a commit that referenced this pull request Oct 16, 2014
Add multitenancy support to Chef client config and local mode
@coderanger coderanger merged commit b6ffdb9 into master Oct 16, 2014
@thommay thommay deleted the jk/multitenant-chef-client-support branch January 23, 2017 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants