This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cool 👍 |
@@ -123,7 +126,11 @@ def install | |||
end | |||
|
|||
def create_spec_for_cookbook(cookbook_name, version) | |||
source_options = default_source.source_options_for(cookbook_name, version) | |||
matching_source = default_source.find { |s| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this ever be nil (say because default_source is the null source)? Would you want to grab default_source.first in case that happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so from looking at the code, but you can only get here via #install
after #graph_solution
is called. There's no way to set up a Policyfile so that #graph_solution
doesn't fail and also there is no source for the cookbook. In any case, I added some tests to demonstrate this.
danielsdeleo
force-pushed
the
multiple-policyfile-sources
branch
from
July 8, 2015 17:10
7c0e195
to
492042f
Compare
Yay! 👍 🚢 |
This was referenced Jul 8, 2015
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #430
This allows you to have multiple
default_source
lines in your policyfile.rb, so you can have achef_repo
with all your org-specific stuff, but pull cookbooks from the public supermarket easily. The way it's designed right now, the cookbook sets need to be disjoint (i.e., there cannot be cookbooks with the same name in both locations). If you manually specify a cookbook's source with acookbook "foo", source_option: "place"
line, though it will be respected. One downside of that is, if there is a conflict between your two sources, and the cookbook is totally irrelevant (wouldn't be in the dependency solution), it'll end up in your policy anyway, because adding thecookbook
line tells chef-dk you want that cookbook around. That said, the 80% case we're targeting here is where there shouldn't be any overlap between, say, supermarket and your chef repo (or internal supermarket), and if there is a conflicting cookbook, it's a mistake.