We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal issue https://chefio.atlassian.net/browse/CHEF-1254
When chef_vault_item was moved into chef client in #9369 the node attributes chef-vault and databag_fallback were never set. Any call to chef_vault_item in test kitchen will result in undefined method '[]' for nil:NilClass for node["chef-vault"]["databag_fallback"].
undefined method '[]' for nil:NilClass
Chef client 16.x-17.x
recipe
value = chef_vault_item('test', 'test')['key'] log "key has value: #{value}"
test data_bag
{ "id": "test", "key": "value" }
Adding the following to the kitchen.yml suite fixes this issue:
attributes: # workaround for chef_vault_item in test kitchen chef-vault: databag_fallback: true
================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/vault_testing/recipes/default.rb ================================================================================ NoMethodError ------------- undefined method `[]' for nil:NilClass Cookbook Trace: (most recent call first) /tmp/kitchen/cache/cookbooks/vault_testing/recipes/default.rb: 1: # 2: # Cookbook:: vault_testing 3: # Recipe:: default 4: # 5: # 6: 7>> value = chef_vault_item('test', 'test')['key'] 8: log "key has value: #{value}" 9: System Info: ------------ chef_version=17.10.3 platform=redhat platform_version=8.6 ruby=ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux] program_name=/opt/chef/bin/chef-client executable=/opt/chef/bin/chef-client
The text was updated successfully, but these errors were encountered:
Seeing that @clintoncwolfe is assigned to the internal issue.
Sorry, something went wrong.
tpowell-progress
No branches or pull requests
Internal issue https://chefio.atlassian.net/browse/CHEF-1254
Description
When chef_vault_item was moved into chef client in #9369 the node attributes chef-vault and databag_fallback were never set. Any call to chef_vault_item in test kitchen will result in
undefined method '[]' for nil:NilClass
for node["chef-vault"]["databag_fallback"].Chef Version
Chef client 16.x-17.x
Platform Version
tested on:
Replication Case
recipe
test data_bag
Workaround
Adding the following to the kitchen.yml suite fixes this issue:
Client Output
The text was updated successfully, but these errors were encountered: