chef-dk 3.6.57 → 3.7.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/Gemfile.lock +54 -54
- data/Rakefile +6 -2
- data/chef-dk.gemspec +2 -2
- data/lib/chef-dk/cli.rb +1 -1
- data/lib/chef-dk/command/clean_policy_cookbooks.rb +1 -1
- data/lib/chef-dk/command/clean_policy_revisions.rb +1 -1
- data/lib/chef-dk/command/delete_policy.rb +1 -1
- data/lib/chef-dk/command/delete_policy_group.rb +1 -1
- data/lib/chef-dk/command/diff.rb +1 -1
- data/lib/chef-dk/command/export.rb +1 -1
- data/lib/chef-dk/command/generate.rb +1 -1
- data/lib/chef-dk/command/generator_commands/generator_generator.rb +1 -1
- data/lib/chef-dk/command/install.rb +1 -1
- data/lib/chef-dk/command/provision.rb +6 -3
- data/lib/chef-dk/command/push.rb +1 -1
- data/lib/chef-dk/command/push_archive.rb +1 -1
- data/lib/chef-dk/command/shell_init.rb +1 -1
- data/lib/chef-dk/command/show_policy.rb +1 -1
- data/lib/chef-dk/command/undelete.rb +1 -1
- data/lib/chef-dk/command/update.rb +1 -1
- data/lib/chef-dk/command/verify.rb +2 -2
- data/lib/chef-dk/generator.rb +4 -4
- data/lib/chef-dk/policyfile/git_lock_fetcher.rb +1 -1
- data/lib/chef-dk/policyfile/uploader.rb +1 -1
- data/lib/chef-dk/policyfile_services/export_repo.rb +2 -2
- data/lib/chef-dk/policyfile_services/push_archive.rb +1 -1
- data/lib/chef-dk/service_exception_inspectors/http.rb +1 -1
- data/lib/chef-dk/version.rb +1 -1
- data/spec/unit/cli_spec.rb +1 -1
- data/spec/unit/command/base_spec.rb +3 -3
- data/spec/unit/command/clean_policy_cookbooks_spec.rb +2 -2
- data/spec/unit/command/clean_policy_revisions_spec.rb +2 -2
- data/spec/unit/command/delete_policy_group_spec.rb +2 -2
- data/spec/unit/command/delete_policy_spec.rb +2 -2
- data/spec/unit/command/export_spec.rb +3 -3
- data/spec/unit/command/generate_spec.rb +1 -1
- data/spec/unit/command/generator_commands/build_cookbook_spec.rb +2 -2
- data/spec/unit/command/generator_commands/cookbook_spec.rb +15 -15
- data/spec/unit/command/generator_commands/generator_generator_spec.rb +1 -1
- data/spec/unit/command/generator_commands/policyfile_spec.rb +1 -1
- data/spec/unit/command/generator_commands/repo_spec.rb +3 -3
- data/spec/unit/command/install_spec.rb +2 -2
- data/spec/unit/command/provision_spec.rb +7 -7
- data/spec/unit/command/push_spec.rb +2 -2
- data/spec/unit/command/shell_init_spec.rb +5 -5
- data/spec/unit/command/show_policy_spec.rb +2 -2
- data/spec/unit/command/undelete_spec.rb +2 -2
- data/spec/unit/command/update_spec.rb +4 -4
- data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +1 -1
- data/spec/unit/policyfile/comparison_base_spec.rb +1 -1
- data/spec/unit/policyfile/differ_spec.rb +8 -8
- data/spec/unit/policyfile/git_lock_fetcher_spec.rb +8 -8
- data/spec/unit/policyfile/local_lock_fetcher_spec.rb +1 -1
- data/spec/unit/policyfile/reports/upload_spec.rb +1 -1
- data/spec/unit/policyfile_demands_spec.rb +5 -5
- data/spec/unit/policyfile_evaluation_spec.rb +3 -3
- data/spec/unit/policyfile_lock_build_spec.rb +14 -14
- data/spec/unit/policyfile_lock_validation_spec.rb +13 -13
- data/spec/unit/policyfile_services/clean_policies_spec.rb +3 -3
- data/spec/unit/policyfile_services/export_repo_spec.rb +2 -2
- data/spec/unit/policyfile_services/install_spec.rb +1 -1
- data/spec/unit/policyfile_services/push_archive_spec.rb +2 -2
- data/spec/unit/policyfile_services/push_spec.rb +1 -1
- data/spec/unit/policyfile_services/show_policy_spec.rb +13 -13
- data/spec/unit/policyfile_services/undelete_spec.rb +1 -1
- data/spec/unit/policyfile_services/update_attributes_spec.rb +1 -1
- data/spec/unit/policyfile_services/update_spec.rb +1 -1
- data/spec/unit/service_exception_inspectors/http_spec.rb +2 -2
- metadata +9 -29
- data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +0 -27
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -287
- data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +0 -52
- data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +0 -51
- data/acceptance/.shared/kitchen_acceptance/metadata.rb +0 -1
- data/acceptance/Gemfile +0 -21
- data/acceptance/Gemfile.lock +0 -335
- data/acceptance/README.md +0 -132
- data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +0 -2
- data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +0 -2
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +0 -1
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +0 -1
- data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +0 -1
- data/acceptance/trivial/.kitchen.yml +0 -7
- data/acceptance/trivial/test/integration/chefdk-current-install/inspec/chef_client_spec.rb +0 -5
- data/tasks/announce.rb +0 -57
- data/tasks/bin/bundle-platform.bat +0 -2
- data/tasks/dependencies.rb +0 -56
- data/tasks/templates/prerelease.md.erb +0 -26
- data/tasks/templates/release.md.erb +0 -26
data/lib/chef-dk/command/diff.rb
CHANGED
@@ -75,7 +75,7 @@ module ChefDK
|
|
75
75
|
# SSL Settings:
|
76
76
|
ssl_verify_mode #{Chef::Config.ssl_verify_mode.inspect}
|
77
77
|
|
78
|
-
CONFIG
|
78
|
+
CONFIG
|
79
79
|
if enable_policyfile
|
80
80
|
policyfile_config = <<~CONFIG
|
81
81
|
# Policyfile Settings:
|
@@ -85,7 +85,7 @@ CONFIG
|
|
85
85
|
policy_group "#{policy_group}"
|
86
86
|
policy_name "#{policy_name}"
|
87
87
|
|
88
|
-
CONFIG
|
88
|
+
CONFIG
|
89
89
|
config << policyfile_config
|
90
90
|
end
|
91
91
|
|
@@ -101,6 +101,8 @@ CONFIG
|
|
101
101
|
class Provision < Base
|
102
102
|
|
103
103
|
banner(<<~E)
|
104
|
+
DEPRECATED: This command is deprecated and will be removed in ChefDK 4.
|
105
|
+
|
104
106
|
Usage: chef provision POLICY_GROUP --policy-name POLICY_NAME [options]
|
105
107
|
chef provision POLICY_GROUP --sync [POLICYFILE_PATH] [options]
|
106
108
|
chef provision --no-policy [options]
|
@@ -134,7 +136,7 @@ CONFIG
|
|
134
136
|
|
135
137
|
Options:
|
136
138
|
|
137
|
-
E
|
139
|
+
E
|
138
140
|
include Configurable
|
139
141
|
|
140
142
|
option :config_file,
|
@@ -226,6 +228,7 @@ E
|
|
226
228
|
end
|
227
229
|
|
228
230
|
def run(params = [])
|
231
|
+
ui.msg("DEPRECATED: This command is deprecated and will be removed in ChefDK 4.")
|
229
232
|
return 1 unless apply_params!(params)
|
230
233
|
chef_config # force chef config to load
|
231
234
|
return 1 unless check_cookbook_and_recipe_path
|
data/lib/chef-dk/command/push.rb
CHANGED
@@ -144,7 +144,7 @@ module ChefDK
|
|
144
144
|
- recipe[aar::default]
|
145
145
|
attributes:
|
146
146
|
|
147
|
-
KITCHEN_YML
|
147
|
+
KITCHEN_YML
|
148
148
|
end
|
149
149
|
|
150
150
|
sh("kitchen list", cwd: cwd)
|
@@ -240,7 +240,7 @@ KITCHEN_YML
|
|
240
240
|
|
241
241
|
Some applications may need or prefer different versions of the chef-provisioning gem or its drivers, so
|
242
242
|
this multiple-version check can fail if a user has installed new versions of those libraries.
|
243
|
-
EOS
|
243
|
+
EOS
|
244
244
|
end
|
245
245
|
|
246
246
|
# ------------
|
data/lib/chef-dk/generator.rb
CHANGED
@@ -89,7 +89,7 @@ module ChefDK
|
|
89
89
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
90
90
|
See the License for the specific language governing permissions and
|
91
91
|
limitations under the License.
|
92
|
-
EOH
|
92
|
+
EOH
|
93
93
|
when "mit"
|
94
94
|
result = <<~EOH
|
95
95
|
The MIT License (MIT)
|
@@ -113,7 +113,7 @@ EOH
|
|
113
113
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
114
114
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
115
115
|
THE SOFTWARE.
|
116
|
-
EOH
|
116
|
+
EOH
|
117
117
|
when "gplv2"
|
118
118
|
result = <<~EOH
|
119
119
|
Copyright:: #{year}, #{copyright_holder}
|
@@ -131,7 +131,7 @@ EOH
|
|
131
131
|
You should have received a copy of the GNU General Public License along
|
132
132
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
133
133
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
134
|
-
EOH
|
134
|
+
EOH
|
135
135
|
when "gplv3"
|
136
136
|
result = <<~EOH
|
137
137
|
Copyright:: #{year}, #{copyright_holder}
|
@@ -148,7 +148,7 @@ EOH
|
|
148
148
|
|
149
149
|
You should have received a copy of the GNU General Public License
|
150
150
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
151
|
-
EOH
|
151
|
+
EOH
|
152
152
|
else
|
153
153
|
raise ArgumentError, "Invalid generator.license setting: #{license}. See available licenses at https://docs.chef.io/ctl_chef.html#chef-generate-cookbook"
|
154
154
|
end
|
@@ -255,7 +255,7 @@ module ChefDK
|
|
255
255
|
exit!(1)
|
256
256
|
end
|
257
257
|
|
258
|
-
CONFIG
|
258
|
+
CONFIG
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
@@ -298,7 +298,7 @@ CONFIG
|
|
298
298
|
policy. However, exported policies contain only a single policy revision, so
|
299
299
|
this policy group name is hardcoded to "local" and should not be changed.
|
300
300
|
|
301
|
-
README
|
301
|
+
README
|
302
302
|
end
|
303
303
|
end
|
304
304
|
|
@@ -92,7 +92,7 @@ module ChefDK
|
|
92
92
|
This archive was created with an older version of ChefDK. This version of
|
93
93
|
ChefDK does not support archives in the older format. Re-create the archive
|
94
94
|
with a newer version of ChefDK or downgrade ChefDK.
|
95
|
-
MESSAGE
|
95
|
+
MESSAGE
|
96
96
|
end
|
97
97
|
|
98
98
|
unless File.exist?(policyfile_lock_path)
|
data/lib/chef-dk/version.rb
CHANGED
data/spec/unit/cli_spec.rb
CHANGED
@@ -51,7 +51,7 @@ describe ChefDK::CLI do
|
|
51
51
|
verify Test the embedded ChefDK applications
|
52
52
|
gem Runs the `gem` command in context of the embedded ruby
|
53
53
|
example Example subcommand for testing
|
54
|
-
E
|
54
|
+
E
|
55
55
|
end
|
56
56
|
|
57
57
|
let(:version_message) { "Chef Development Kit Version: #{ChefDK::VERSION}\n" }
|
@@ -109,7 +109,7 @@ describe ChefDK::Command::Base do
|
|
109
109
|
-u, --user If the user exists
|
110
110
|
-v, --version Show chef version
|
111
111
|
|
112
|
-
E
|
112
|
+
E
|
113
113
|
expect(stdout).to eq(expected)
|
114
114
|
end
|
115
115
|
|
@@ -129,7 +129,7 @@ E
|
|
129
129
|
-u, --user If the user exists
|
130
130
|
-v, --version Show chef version
|
131
131
|
|
132
|
-
E
|
132
|
+
E
|
133
133
|
expect(stdout).to eq(expected)
|
134
134
|
|
135
135
|
end
|
@@ -149,7 +149,7 @@ E
|
|
149
149
|
50: chefdk.foo "bar"
|
150
150
|
51:
|
151
151
|
|
152
|
-
MESSAGE
|
152
|
+
MESSAGE
|
153
153
|
end
|
154
154
|
|
155
155
|
let(:exception) { Chef::Exceptions::ConfigurationError.new(exception_message) }
|
@@ -138,7 +138,7 @@ describe ChefDK::Command::CleanPolicyCookbooks do
|
|
138
138
|
Error: Failed to delete some policy revisions.
|
139
139
|
Reason: (StandardError) some operation failed
|
140
140
|
|
141
|
-
E
|
141
|
+
E
|
142
142
|
|
143
143
|
expect(ui.output).to eq(expected_output)
|
144
144
|
end
|
@@ -154,7 +154,7 @@ E
|
|
154
154
|
Reason: (StandardError) some operation failed
|
155
155
|
|
156
156
|
|
157
|
-
E
|
157
|
+
E
|
158
158
|
expected_output << backtrace.join("\n") << "\n"
|
159
159
|
|
160
160
|
expect(ui.output).to eq(expected_output)
|
@@ -138,7 +138,7 @@ describe ChefDK::Command::CleanPolicyRevisions do
|
|
138
138
|
Error: Failed to delete some policy revisions.
|
139
139
|
Reason: (StandardError) some operation failed
|
140
140
|
|
141
|
-
E
|
141
|
+
E
|
142
142
|
|
143
143
|
expect(ui.output).to eq(expected_output)
|
144
144
|
end
|
@@ -154,7 +154,7 @@ E
|
|
154
154
|
Reason: (StandardError) some operation failed
|
155
155
|
|
156
156
|
|
157
|
-
E
|
157
|
+
E
|
158
158
|
expected_output << backtrace.join("\n") << "\n"
|
159
159
|
|
160
160
|
expect(ui.output).to eq(expected_output)
|
@@ -165,7 +165,7 @@ describe ChefDK::Command::DeletePolicyGroup do
|
|
165
165
|
Error: Failed to delete policy group
|
166
166
|
Reason: (StandardError) some operation failed
|
167
167
|
|
168
|
-
E
|
168
|
+
E
|
169
169
|
|
170
170
|
expect(ui.output).to eq(expected_output)
|
171
171
|
end
|
@@ -180,7 +180,7 @@ E
|
|
180
180
|
Reason: (StandardError) some operation failed
|
181
181
|
|
182
182
|
|
183
|
-
E
|
183
|
+
E
|
184
184
|
expected_output << backtrace.join("\n") << "\n"
|
185
185
|
|
186
186
|
expect(ui.output).to eq(expected_output)
|
@@ -165,7 +165,7 @@ describe ChefDK::Command::DeletePolicy do
|
|
165
165
|
Error: Failed to delete policy.
|
166
166
|
Reason: (StandardError) some operation failed
|
167
167
|
|
168
|
-
E
|
168
|
+
E
|
169
169
|
|
170
170
|
expect(ui.output).to eq(expected_output)
|
171
171
|
end
|
@@ -180,7 +180,7 @@ E
|
|
180
180
|
Reason: (StandardError) some operation failed
|
181
181
|
|
182
182
|
|
183
|
-
E
|
183
|
+
E
|
184
184
|
expected_output << backtrace.join("\n") << "\n"
|
185
185
|
|
186
186
|
expect(ui.output).to eq(expected_output)
|
@@ -136,7 +136,7 @@ describe ChefDK::Command::Export do
|
|
136
136
|
To converge this system with the exported policy, run:
|
137
137
|
cd /path/to/export
|
138
138
|
chef-client -z
|
139
|
-
MESSAGE
|
139
|
+
MESSAGE
|
140
140
|
expect(ui.output).to include(expected_message)
|
141
141
|
end
|
142
142
|
end
|
@@ -168,7 +168,7 @@ MESSAGE
|
|
168
168
|
Error: export failed
|
169
169
|
Reason: (StandardError) some operation failed
|
170
170
|
|
171
|
-
E
|
171
|
+
E
|
172
172
|
|
173
173
|
command.run(params)
|
174
174
|
expect(ui.output).to eq(expected_error_text)
|
@@ -184,7 +184,7 @@ E
|
|
184
184
|
Reason: (StandardError) some operation failed
|
185
185
|
|
186
186
|
|
187
|
-
E
|
187
|
+
E
|
188
188
|
|
189
189
|
expected_error_text << backtrace.join("\n") << "\n"
|
190
190
|
|
@@ -201,7 +201,7 @@ describe ChefDK::Command::GeneratorCommands::BuildCookbook do
|
|
201
201
|
chef_version '>= 13.0'
|
202
202
|
|
203
203
|
depends 'delivery-truck'
|
204
|
-
METADATA
|
204
|
+
METADATA
|
205
205
|
end
|
206
206
|
end
|
207
207
|
end
|
@@ -258,7 +258,7 @@ METADATA
|
|
258
258
|
maintainer_email 'you@example.com'
|
259
259
|
license 'all_rights'
|
260
260
|
version '0.1.0'
|
261
|
-
METADATA
|
261
|
+
METADATA
|
262
262
|
end
|
263
263
|
end
|
264
264
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright:: Copyright (c) 2014-
|
2
|
+
# Copyright:: Copyright (c) 2014-2019 Chef Software Inc.
|
3
3
|
# License:: Apache License, Version 2.0
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -72,7 +72,7 @@ describe ChefDK::Command::GeneratorCommands::Cookbook do
|
|
72
72
|
If you'd prefer to dive right in, the default recipe can be found at:
|
73
73
|
|
74
74
|
recipes/default.rb
|
75
|
-
EOF
|
75
|
+
EOF
|
76
76
|
end
|
77
77
|
|
78
78
|
subject(:cookbook_generator) do
|
@@ -216,7 +216,7 @@ EOF
|
|
216
216
|
# of the `delivery local` command across many different projects.
|
217
217
|
#
|
218
218
|
# remote_file = "https://url/project.toml"
|
219
|
-
PROJECT_DOT_TOML
|
219
|
+
PROJECT_DOT_TOML
|
220
220
|
end
|
221
221
|
|
222
222
|
it "exists with default config for Cookbook Workflow" do
|
@@ -248,7 +248,7 @@ PROJECT_DOT_TOML
|
|
248
248
|
},
|
249
249
|
"dependencies": []
|
250
250
|
}
|
251
|
-
|
251
|
+
CONFIG_DOT_JSON
|
252
252
|
end
|
253
253
|
|
254
254
|
it "configures delivery to use a local build cookbook" do
|
@@ -269,9 +269,9 @@ PROJECT_DOT_TOML
|
|
269
269
|
# Cookbook:: build_cookbook
|
270
270
|
# Recipe:: publish
|
271
271
|
#
|
272
|
-
# Copyright::
|
272
|
+
# Copyright:: 2019, The Authors, All Rights Reserved.
|
273
273
|
include_recipe 'delivery-truck::publish'
|
274
|
-
|
274
|
+
CONFIG_DOT_JSON
|
275
275
|
end
|
276
276
|
|
277
277
|
it "delegates functionality to delivery-truck" do
|
@@ -295,7 +295,7 @@ PROJECT_DOT_TOML
|
|
295
295
|
group :delivery do
|
296
296
|
cookbook 'test', path: './test/fixtures/cookbooks/test'
|
297
297
|
end
|
298
|
-
|
298
|
+
CONFIG_DOT_JSON
|
299
299
|
end
|
300
300
|
|
301
301
|
it "sets the sources for delivery library cookbooks to github" do
|
@@ -369,7 +369,7 @@ PROJECT_DOT_TOML
|
|
369
369
|
- Merging delivery content feature branch to master
|
370
370
|
|
371
371
|
#{non_delivery_breadcrumb}
|
372
|
-
OUTPUT
|
372
|
+
OUTPUT
|
373
373
|
|
374
374
|
actual = stdout_io.string
|
375
375
|
|
@@ -421,7 +421,7 @@ OUTPUT
|
|
421
421
|
- Merging delivery content feature branch to master
|
422
422
|
|
423
423
|
Your cookbook is ready. To setup the pipeline, type `cd new_cookbook`, then run `delivery init`
|
424
|
-
OUTPUT
|
424
|
+
OUTPUT
|
425
425
|
|
426
426
|
actual = stdout_io.string
|
427
427
|
|
@@ -542,7 +542,7 @@ OUTPUT
|
|
542
542
|
|
543
543
|
# Specify a custom source for a single cookbook:
|
544
544
|
cookbook 'new_cookbook', path: '.'
|
545
|
-
POLICYFILE_RB
|
545
|
+
POLICYFILE_RB
|
546
546
|
end
|
547
547
|
|
548
548
|
before do
|
@@ -595,7 +595,7 @@ POLICYFILE_RB
|
|
595
595
|
inspec_tests:
|
596
596
|
- test/integration/default
|
597
597
|
attributes:
|
598
|
-
KITCHEN_YML
|
598
|
+
KITCHEN_YML
|
599
599
|
end
|
600
600
|
|
601
601
|
end
|
@@ -607,7 +607,7 @@ KITCHEN_YML
|
|
607
607
|
# frozen_string_literal: true
|
608
608
|
require 'chefspec'
|
609
609
|
require 'chefspec/policyfile'
|
610
|
-
SPEC_HELPER
|
610
|
+
SPEC_HELPER
|
611
611
|
end
|
612
612
|
|
613
613
|
end
|
@@ -628,7 +628,7 @@ SPEC_HELPER
|
|
628
628
|
source 'https://supermarket.chef.io'
|
629
629
|
|
630
630
|
metadata
|
631
|
-
POLICYFILE_RB
|
631
|
+
POLICYFILE_RB
|
632
632
|
end
|
633
633
|
|
634
634
|
before do
|
@@ -674,7 +674,7 @@ POLICYFILE_RB
|
|
674
674
|
inspec_tests:
|
675
675
|
- test/integration/default
|
676
676
|
attributes:
|
677
|
-
KITCHEN_YML
|
677
|
+
KITCHEN_YML
|
678
678
|
end
|
679
679
|
|
680
680
|
end
|
@@ -686,7 +686,7 @@ KITCHEN_YML
|
|
686
686
|
# frozen_string_literal: true
|
687
687
|
require 'chefspec'
|
688
688
|
require 'chefspec/berkshelf'
|
689
|
-
SPEC_HELPER
|
689
|
+
SPEC_HELPER
|
690
690
|
end
|
691
691
|
|
692
692
|
end
|