-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to reference resources from dependencies
All resources from deps are added into the control_eval_context used by the current profile. However, if there is a name conflict, the last loaded resource wins. This new syntax: resource(profile_name, resource_name, resource_args) allows users to specify the exact resource they mean. Signed-off-by: Steven Danna <steve@chef.io>
- Loading branch information
1 parent
913a8fd
commit 3130afc
Showing
8 changed files
with
125 additions
and
58 deletions.
There are no files selected for viewing
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
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
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
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
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
16 changes: 16 additions & 0 deletions
16
test/unit/mock/profiles/dependencies/resource-namespace/controls/example.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# encoding: utf-8 | ||
# copyright: 2015, The Authors | ||
# license: All rights reserved | ||
control 'whichgordon' do | ||
describe gordon_config do | ||
its('version') { should eq('2.0') } | ||
end | ||
|
||
describe resource('profile_d', 'gordon_config') do | ||
its('version') { should eq('2.0') } | ||
end | ||
|
||
describe resource('profile_c', 'gordon_config') do | ||
its('version') { should eq('1.0') } | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
test/unit/mock/profiles/dependencies/resource-namespace/inspec.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: resource-namespace | ||
title: InSpec Profile | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: you@example.com | ||
license: All Rights Reserved | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
depends: | ||
- name: profile_a | ||
path: '../profile_a' | ||
- name: profile_d | ||
path: '../profile_d' |
Empty file.