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 install ignores chef_server source #152

Open
mattray opened this issue Aug 18, 2020 · 3 comments
Open

chef install ignores chef_server source #152

mattray opened this issue Aug 18, 2020 · 3 comments
Labels
Status: Waiting on Contributor A pull request that has unresolved requested actions from the author.

Comments

@mattray
Copy link
Contributor

mattray commented Aug 18, 2020

The policyfile lock.json contains the following

      "origin": "https://api.chef.server.xyz/organizations/org_cookbooks",
      "source_options": {
        "chef_server": "https://api.chef.server.xyz/organizations/org_cookbooks",
        "version": "11.5.0"

but when chef install is called against the lock file it goes to the chef_server_url from the knife.rb (https://api.chef.server.xyz/organizations/testing). In this case the user had access to both orgs, but the cookbook was not at the one in the knife.rb

$ chef -v
ChefDK version: 4.7.73
Chef Infra Client version: 15.7.32
Chef InSpec version: 4.18.51
Test Kitchen version: 2.3.4
Foodcritic version: 16.2.0
Cookstyle version: 5.20.0
@tyler-ball
Copy link
Contributor

tyler-ball commented Aug 19, 2020

That is strange. Is your knife.rb in the normal location (~/.chef)? Do you mean chef push instead of chef install? Or do you mean it tries to generate the lock file using the chef server from your config instead of the Policyfile?

This code hasn't changed much so I doubt this is it, but could you try this with the latest version of Chef Workstation?

@tas50 tas50 transferred this issue from chef/chef-workstation Feb 13, 2021
@marcparadise marcparadise added the Status: Waiting on Contributor A pull request that has unresolved requested actions from the author. label Feb 17, 2021
@marcparadise
Copy link
Member

@mattray do you have any update for tyler's questions above?

@kisoku
Copy link

kisoku commented Feb 18, 2021

@marcparadise I am the customer Matt filed this issue on the behalf of. We are using knife.rb in the normal location albeit with knife-block, so knife.rb is a symlink. It is not on push, it is whenever we are running chef install to repopulate the local cache from an existing lockfile. So for example, a developer creates a policyfile and associate lockfile and checks it into a chef repo. A CI process must rebuild the cookbook cache with chef install before it can perform chef push.

We noticed in this scenario that chef install ignores the source_options completely and will use whatever chef_server_url is set to by the active knife.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting on Contributor A pull request that has unresolved requested actions from the author.
Projects
None yet
Development

No branches or pull requests

4 participants