From 9d12161778af613ba15fb23f0433f56c6bf490eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 9 Nov 2025 00:01:17 +0000 Subject: [PATCH 1/5] Initial plan From f93f017fd76c0c0f16c1d320c74289d9506ad10c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 9 Nov 2025 22:03:16 +0000 Subject: [PATCH 2/5] Add vendor directory to .gitignore Co-authored-by: damacus <40786+damacus@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9106b648..c94a2dd7 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ tmp .kitchen.local.yml Dockerfile .DS_Store +vendor/ From 181a42132ba697edef5a6a04a450ba91e33fe057 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:42:43 +0000 Subject: [PATCH 3/5] Fix curl package conflict in Amazon Linux 2022 images - Add separate amazonlinux_platform method with --allowerasing flag - Split amazonlinux from rhel platform handling - Add comprehensive tests for dockerfile helper - All tests passing Co-authored-by: damacus <40786+damacus@users.noreply.github.com> --- .../docker/helpers/dockerfile_helper.rb | 13 ++- test/spec/dockerfile_helper_spec.rb | 109 ++++++++++++++++++ 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 test/spec/dockerfile_helper_spec.rb diff --git a/lib/kitchen/docker/helpers/dockerfile_helper.rb b/lib/kitchen/docker/helpers/dockerfile_helper.rb index 24f601c5..d24519c2 100644 --- a/lib/kitchen/docker/helpers/dockerfile_helper.rb +++ b/lib/kitchen/docker/helpers/dockerfile_helper.rb @@ -34,8 +34,10 @@ def dockerfile_platform gentoo_paludis_platform when "opensuse/tumbleweed", "opensuse/leap", "opensuse", "sles" opensuse_platform - when "rhel", "centos", "oraclelinux", "amazonlinux" + when "rhel", "centos", "oraclelinux" rhel_platform + when "amazonlinux" + amazonlinux_platform when "centosstream" centosstream_platform when "almalinux" @@ -117,6 +119,15 @@ def rhel_platform CODE end + def amazonlinux_platform + <<-CODE + ENV container=docker + RUN yum clean all + RUN yum install -y --allowerasing sudo openssh-server openssh-clients which curl + RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' + CODE + end + def centosstream_platform <<-CODE ENV container=docker diff --git a/test/spec/dockerfile_helper_spec.rb b/test/spec/dockerfile_helper_spec.rb new file mode 100644 index 00000000..095d1a90 --- /dev/null +++ b/test/spec/dockerfile_helper_spec.rb @@ -0,0 +1,109 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require "spec_helper" +require "kitchen/docker/helpers/dockerfile_helper" + +describe Kitchen::Docker::Helpers::DockerfileHelper do + let(:helper_class) do + Class.new do + include Kitchen::Docker::Helpers::DockerfileHelper + attr_accessor :config + + def initialize(config = {}) + @config = config + end + end + end + + let(:helper) { helper_class.new(platform:) } + + describe "#amazonlinux_platform" do + let(:platform) { "amazonlinux" } + + it "includes --allowerasing flag for yum install" do + result = helper.amazonlinux_platform + expect(result).to include("yum install -y --allowerasing") + end + + it "installs required packages including curl" do + result = helper.amazonlinux_platform + expect(result).to include("sudo openssh-server openssh-clients which curl") + end + + it "sets container environment variable" do + result = helper.amazonlinux_platform + expect(result).to include("ENV container=docker") + end + + it "generates SSH host key if missing" do + result = helper.amazonlinux_platform + expect(result).to include("ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key") + end + end + + describe "#rhel_platform" do + let(:platform) { "rhel" } + + it "does not include --allowerasing flag" do + result = helper.rhel_platform + expect(result).not_to include("--allowerasing") + end + + it "installs required packages including curl" do + result = helper.rhel_platform + expect(result).to include("sudo openssh-server openssh-clients which curl") + end + end + + describe "#dockerfile_platform" do + context "when platform is amazonlinux" do + let(:platform) { "amazonlinux" } + + it "calls amazonlinux_platform method" do + expect(helper).to receive(:amazonlinux_platform).and_call_original + result = helper.dockerfile_platform + expect(result).to include("--allowerasing") + end + end + + context "when platform is rhel" do + let(:platform) { "rhel" } + + it "calls rhel_platform method" do + expect(helper).to receive(:rhel_platform).and_call_original + result = helper.dockerfile_platform + expect(result).not_to include("--allowerasing") + end + end + + context "when platform is centos" do + let(:platform) { "centos" } + + it "calls rhel_platform method" do + expect(helper).to receive(:rhel_platform).and_call_original + helper.dockerfile_platform + end + end + + context "when platform is oraclelinux" do + let(:platform) { "oraclelinux" } + + it "calls rhel_platform method" do + expect(helper).to receive(:rhel_platform).and_call_original + helper.dockerfile_platform + end + end + end +end From 028e75e1e03460155377998ed363d520df8f971b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 08:09:40 +0000 Subject: [PATCH 4/5] Update lint-unit workflow reference to main branch Change test-kitchen/.github workflow reference from v0.1.2 to main Co-authored-by: damacus <40786+damacus@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9b99db6..6b55a5b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ name: Lint & Unit jobs: lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2 + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main integration-windows: name: Windows ${{matrix.suite}} ${{matrix.os}} From 9e7e59d801bc08e2cff3bc534f6bb35e86c7b5d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Dec 2025 06:32:17 +0000 Subject: [PATCH 5/5] Fix markdown lint issues in README.md Replace non-descriptive "here" link text with descriptive "Resource Management Guide" to comply with MD059 markdownlint rule Co-authored-by: damacus <40786+damacus@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c9a47a4..641f24fd 100644 --- a/README.md +++ b/README.md @@ -292,12 +292,12 @@ Examples: ### memory Sets the memory limit for the suite container in bytes. Otherwise use Dockers -default. You can read more about `memory.limit_in_bytes` [here][memory_limit]. +default. You can read more about `memory.limit_in_bytes` in the [Resource Management Guide][memory_limit]. ### cpu Sets the CPU shares (relative weight) for the suite container. Otherwise use -Dockers defaults. You can read more about cpu.shares [here][cpu_shares]. +Dockers defaults. You can read more about cpu.shares in the [Resource Management Guide][cpu_shares]. ### volume