Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Molly Waggett <mwaggett@alumni.reed.edu>
  • Loading branch information
reidmv and mwaggett authored Dec 4, 2020
1 parent 50acb3f commit a684ae6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Unreleased
----------

- Fetch modules from the repo's default branch, rather than defaulting to 'master' [#1096](https://github.com/puppetlabs/r10k/issues/1096)
- Enable configurable behavior of environment module / Puppetfile module conflicts (experimental features)
- Experimental feature change: conflicts between environment-defined modules and Puppetfile-defined modules now default to logging a warning and deploying the environment module version, overriding the Puppetfile. Previously, conflicts would result in an error. The behavior is now configurable via the `module_conflicts` environment setting [#1107](https://github.com/puppetlabs/r10k/pull/1107)

3.7.0
-----
Expand Down
4 changes: 2 additions & 2 deletions doc/dynamic-environments/configuration.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,8 @@ When a module is defined in an environment and also in a Puppetfile, the default

Available `module_conflicts` options:

* `override_puppetfile_and_warn` (default): the version of the module defined by the enviornment will be used, and the version defined in the Puppetfile will be ignored. A warning will be printed.
* `override_puppetfile`: the version of the module defined by the enviornment will be used, and the version defined in the Puppetfile will be ignored.
* `override_puppetfile_and_warn` (default): the version of the module defined by the environment will be used, and the version defined in the Puppetfile will be ignored. A warning will be printed.
* `override_puppetfile`: the version of the module defined by the environment will be used, and the version defined in the Puppetfile will be ignored.
* `error`: an error will be raised alerting the user to the conflict. The environment will not be deployed.

```yaml
Expand Down
3 changes: 2 additions & 1 deletion spec/unit/environment/with_modules_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
mod = double('duplicate-stdlib', :name => 'stdlib')
expect(subject.puppetfile).to receive(:load)
expect(subject.puppetfile).to receive(:modules).and_return [mod]
expect(subject.logger).to receive(:warn).with(/Puppetfile.*both define.*ignored/i)
expect { subject.validate_no_module_conflicts }.not_to raise_error
end
end

context "with module conflicts and 'error' behavior" do
let(:subject_params) {{ :module_conflicts => 'error' }}
it "does not raise an error" do
it "raises an error" do
mod = double('duplicate-stdlib', :name => 'stdlib')
expect(subject.puppetfile).to receive(:load)
expect(subject.puppetfile).to receive(:modules).and_return [mod]
Expand Down

0 comments on commit a684ae6

Please sign in to comment.