Skip to content
New issue

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

Chef/Modernize/CronDFileOrTemplate triggers on cron.daily #954

Open
ddamw opened this issue Mar 9, 2022 · 0 comments
Open

Chef/Modernize/CronDFileOrTemplate triggers on cron.daily #954

ddamw opened this issue Mar 9, 2022 · 0 comments
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@ddamw
Copy link

ddamw commented Mar 9, 2022

Version:

Chef Workstation 22.2.807
Cookstyle 7.32.0

Environment:

Debian 11

Scenario:

We use a cookbook_file resource to process a file in /etc/cron.daily

Steps to Reproduce:

Add the following resource to a cookbook recipe:

cookbook_file '/etc/cron.daily/locate' do
  source 'locate'
  owner 'root'
  group 'root'
  mode '755'
end

Then run cookstyle

Expected Result:

I expect no warning from this.

Actual Result:

Chef/Modernize/CronDFileOrTemplate: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources (https://docs.chef.io/workstation/cookstyle/chef_modernize_crondfileortemplate) cookbook_file '/etc/cron.daily/locate' do ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I am guessing that the cop is triggering on cron.d*, instead of just cron.d

#946 seems to have a very similar issue

FYI: cron.daily is a directory where scripts can be dropped that run daily, cron.d is a directory where cron jobs with full cron configuration (i.e.: with time, user, etc) are placed.

@ddamw ddamw added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant