Closed pdohertybcov closed 4 years ago
It looks like Cookstyle 6.8 fixes this, by using both provides
and resource_name
to maintain compatibility with Chef Client 15 and earlier.
From the Cookstyle release notes:
Chef Infra Client 16.2 contains additional changes to how resource names are specified in order to avoid edge cases in resource naming. When setting the name of a custom resource provides should now be used instead of resource_name. If writing cookbooks that support Chef Infra Client < 16 you'll want to use both provides and resource_name to support all releases.
To support these changes we've made several updates to existing cops. The ChefDeprecations/ResourceUsesOnlyResourceName cop has been updated to add provides in addition to resoure_name instead of replacing resource_name with provides. This change ensures cookbooks continue to function on Chef Infra Client less than 16. The ChefDeprecations/ResourceWithoutNameOrProvides cop has also been renamed to ChefDeprecations/HWRPWithoutProvides and improves detection of resources without provides. Both cops now better validate the contents of existing provides calls.
We're using Cinc 15 and are stumbling over the same problem, too.
I am getting the same error with chef-client 14 chef_version=14.15.6 platform=centos platform_version=7.8.2003
[2020-07-21T17:05:31-05:00] FATAL: Chef::Exceptions::InvalidResourceSpecification: [ins_1].resource_name is nil
! Did you forget to put provides :blah
or resource_name :blah
in your resource class?
:speaking_head: Foreword
release 8.7.2 produces fatal errors with chef-client 12
:ghost: Brief Description
PR #631 appears to have broken this cookbook for Chef-Client 12 (specifically I'm using 12.21.14)
I get this
:pancakes: Cookbook version
8.7.2
:woman_cook: Chef-Infra Version
12.21.14
:tophat: Platform details
CentOS 7.8.2003
Steps To Reproduce
Steps to reproduce the behavior: Using chef-client 12, create a simple call to the resource.
Test Kitchen will fail with the error above.
:police_car: Expected behavior
It should converge without errors, like it did in release 8.7.1
:heavy_plus_sign: Additional context
If you're dropping support for chef-client 12, then the cookbook should see a minor or major version change, and the readme needs updating.
Thanks!