Skip to content

Commit 000802f

Browse files
This previous change worked around a bug in Knife that limited use of characters in data bags. See [CHEF-3531](chef/chef#1104) for more information. This reverts commit 7b091cf. Conflicts: providers/manage.rb spec/default_spec.rb
1 parent ecd6330 commit 000802f

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
certificate cookbook changelog
22
==============================
33

4+
v0.8.0
5+
------
6+
7+
Revert #38
8+
9+
This previous change worked around a bug in Knife that limited use of characters
10+
in data bags. See [CHEF-3531](https://github.com/chef/chef/pull/1104) for more information.
11+
12+
This reverts commit 7b091cfe039da729926d12a4e31da2db6aceb007.
13+
414
v0.7.0
515
------
616

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Into this:
6464

6565
Finally, you'll want to create the data bag object to contain your certs,
6666
keys, and optionally your CA root chain bundle. The default recipe uses
67-
the OHAI attribute *hostname* as a *search_id*. With version 0.7.0, and newer,
68-
one can use an *fqdn* as the *search_id*, the library will normalize dots into
69-
underscores.
67+
the OHAI attribute *hostname* as a *search_id*. One can use an *fqdn* as the *search_id*.
68+
Older versions of Knife have a strict character filter list which prevents the use of `.`
69+
separators in data bag IDs.
7070

7171
The cookbook also contains an example *wildcard* recipe to use with wildcard
7272
certificates (\*.example.com) certificates.

providers/manage.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def whyrun_supported?
2424
use_inline_resources if defined?(use_inline_resources)
2525

2626
action :create do
27-
search_id = new_resource.search_id.gsub('.', '_')
2827
ssl_secret = Chef::EncryptedDataBagItem.load_secret(new_resource.data_bag_secret)
2928
ssl_item =
3029
begin

resources/manage.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(*args)
3232
attribute :search_id, :kind_of => String, :name_attribute => true
3333
attribute :ignore_missing, :kind_of => [TrueClass, FalseClass], :default => false
3434

35-
# :ngnix_cert is a PEM which combine host cert and CA trust chain for nginx.
35+
# :nginx_cert is a PEM which combine host cert and CA trust chain for nginx.
3636
# :combined_file is a PEM which combine certs and keys in one file, for things such as haproxy.
3737
# :cert_file is the filename for the managed certificate.
3838
# :key_file is the filename for the managed key.

spec/default_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
end.converge(described_recipe)
1515
end
1616

17-
it 'Replace dots with underscore in item name to search' do
17+
# This was a bug in Knife, see CHEF-3531
18+
it '[Issue #38] does not normalize dots in hostnames' do
1819
allow(Chef::EncryptedDataBagItem).to receive(:load)
19-
.with('certificates', 'example_com', @secret)
20+
.with('certificates', 'example.com', @secret)
2021
.and_return(@data_bag_item_content)
2122
expect(chef_run).to create_certificate_manage('example.com')
2223
end

0 commit comments

Comments
 (0)