From 4eb678922dbdca936cc4c39e6a0fab9b08e23359 Mon Sep 17 00:00:00 2001 From: John McCrae Date: Thu, 6 Nov 2025 14:30:25 +0000 Subject: [PATCH] updating code to account for removing the chef-version Signed-off-by: John McCrae --- CHANGELOG.md | 7 +++++++ spec/run_oc_pedant.rb | 20 ++------------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a068f6..879a845 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ - Remove active support, it does not seem to be used [#349](https://github.com/chef/chef-zero/pull/349) ([jaymzh](https://github.com/jaymzh)) + +## Unreleased + +#### Changed +- Remove obsolete Chef version checks for ancient Chef versions (< 12.13.19 from 2016). All modern Chef versions support keys, ACL, cookbook-artifacts, and policies. + + ### Changes not yet released to rubygems.org diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index de04bc4..0f12d9d 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -52,13 +52,6 @@ def start_cheffs_server(chef_repo_path) Dir.mkdir(chef_repo_path) unless File.exist?(chef_repo_path) - # 11.6 and below had a bug where it couldn't create the repo children automatically - if Chef::VERSION.to_f < 11.8 - %w{clients cookbooks data_bags environments nodes roles users}.each do |child| - Dir.mkdir("#{chef_repo_path}/#{child}") unless File.exist?("#{chef_repo_path}/#{child}") - end - end - # Start the new server Chef::Config.repo_mode = "hosted_everything" Chef::Config.chef_repo_path = chef_repo_path @@ -125,7 +118,8 @@ def args_from_env(key) Pedant.config[:config_file] = "spec/support/oc_pedant.rb" # Because ChefFS can only ever have one user (pivotal), we can't do most of the - # tests that involve multiple + # tests that involve multiple users. All modern Chef versions (>= 12.13.19) + # support keys, ACL, cookbook-artifacts, and policies, so we don't skip those. chef_fs_skips = if ENV["CHEF_FS"] [ "--skip-association", "--skip-users", @@ -137,16 +131,6 @@ def args_from_env(key) [] end - unless Gem::Requirement.new(">= 12.8.0").satisfied_by?(Gem::Version.new(Chef::VERSION)) - chef_fs_skips << "--skip-keys" - end - - unless Gem::Requirement.new(">= 12.13.19").satisfied_by?(Gem::Version.new(Chef::VERSION)) - chef_fs_skips << "--skip-acl" - chef_fs_skips << "--skip-cookbook-artifacts" - chef_fs_skips << "--skip-policies" - end - # These things aren't supported by Chef Zero in any mode of operation: default_skips = [ # "the goal is that only authorization, authentication and validation tests