-
Notifications
You must be signed in to change notification settings - Fork 28
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
Use correct user-association endpoint for Chef 12 #50
Conversation
Tests are failing as expected. I think to completely fix them we likely need some changes in chef-zero as well. Getting chef-zero in line with Chef Server 12 was started here: |
Can you update https://github.com/chef/cheffish/blob/master/spec/integration/chef_organization_spec.rb to add testing for this? If chef-zero is updated it will no longer throw a 405 but I would expect the specs that test this functionality to fail. This is also a breaking change for old versions of chef-server, correct? So this would either need to be released as a major version or it would need to be updated to support both CS11 and CS12. |
It looks like the integration tests only test against Chef Server 12. Do we even care about supporting Chef Server 11? |
Chef Server 11 is supported until Chef Server 13 comes out. In my opinion all API clients we maintain should support both. |
As part of a larger effort to make use of our own primitives, the test::post-install recipe should use Cheffish chef_user and chef_organization resources to create the example user and organization. It may be many more lines of code, but at the end of the day it is declarative, and these resources are inherently both convergent and idempotent. Running the chef-server-ctl commands requires a guard, which parses output that can change more easily in a user-facing tool. The Cheffish resources use the REST API of the Chef Server, and changes to the API itself is made with far more consideration. That said, there's a bug in the Cheffish chef_organization resource, addressed by the following pull request: chef/cheffish#50 As such, we install the Cheffish gem built from the branch in that PR. When that is merged and a new Cheffish gem is released, then we can remove the git and rake use in the recipe, and just use chef_gem.
I'm going to mark this as |
919a5d3
to
b602f5d
Compare
@stevendanna I just force pushed this. There is still 1 test failing so I'm going to troubleshoot that next. |
|
@tyler-ball this change looks good assuming the endpoint is the way it looks. Is the above test failure actually caused by this change? |
@jkeiser yes - the failures were different before this change. |
The correct endpoint for user-association is: POST /organizations/ORGNAME/users The API currently being made will be rejected with a 405 Method Not Allowed error.
…be CS12 compatiable
b602f5d
to
c5a7dbb
Compare
Yeah, it looks like that is likely a chef-zero issue: if you do the POST thing to add a user to an org, it should remove any association requests as well. |
d7bf1c4
to
e2bd4db
Compare
e2bd4db
to
3e5c0db
Compare
Use correct user-association endpoint for Chef 12
The correct endpoint for user-association is:
POST /organizations/ORGNAME/users
The API currently being made will be rejected with a 405 Method Not
Allowed error.