knife config set does not work in cinc-workstation
knife config use
does not work in cinc-workstation, because the context file setting the config profile to be used is set in ~/.chef/context
rather than ~/.cinc/context
.
Presumably this is due to this line not using the ChefUtils::Dist::Infra::USER_CONF_DIR
and just using .chef
.
I'd be happy to put up a PR to fix this but I'm not entirely sure where it should go! I think against the upstream chef repo to change the .chef
to the USER_CONF_DIR helper?
Reproduction
With a ~/.cinc/credentials
file like the following:
[default]
client_name = 'testclient'
client_key = 'testclient.pem'
chef_server_url = 'https://chef.example.com/organizations/test-org-one'
[one]
client_name = 'testclient'
client_key = 'testclient.pem'
chef_server_url = 'https://chef.example.com/organizations/test-org-one'
[two]
client_name = 'testclient'
client_key = 'testclient.pem'
chef_server_url = 'https://chef.example.com/organizations/test-org-two'
- If you run
knife config use two
, it will write the context file to~/.chef/context
with the contentstwo
- Then running
knife config show
will still show the default profile config, and any knife actions you take will apply to the default profile, nottwo
Edited by Mia Henderson