Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@v0.2.3

integration-windows:
name: Windows ${{matrix.suite}} ${{matrix.os}}
Expand Down
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
require:
- chefstyle
- cookstyle/chefstyle

AllCops:
TargetRubyVersion: 3.1
Expand Down
16 changes: 8 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec

group :development do
gem 'kitchen-inspec', '~> 2.0'
gem 'train', '>= 2.1', '< 4.0' # validate 4.x when it's released
gem "kitchen-inspec", "~> 2.0"
gem "train", ">= 2.1", "< 4.0" # validate 4.x when it's released
end

group :test do
gem 'bundler'
gem 'rake'
gem 'rspec', '~> 3.2'
gem 'rspec-its', '~> 2.0'
gem "bundler"
gem "rake"
gem "rspec", "~> 3.2"
gem "rspec-its", "~> 2.0"
end

group :chefstyle do
gem 'chefstyle', '~> 2.2', '>= 2.2.3'
gem "cookstyle"
end
2 changes: 1 addition & 1 deletion kitchen-docker.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib = File.expand_path("lib", __FILE__)
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "kitchen/docker/docker_version"

Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/docker/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create(state)
if container_exists?(state)
info("Container ID #{state[:container_id]} already exists.")
elsif !container_exists?(state) && state[:container_id]
raise ActionFailed, "Container ID #{state[:container_id]} was found in the kitchen state data, "\
raise ActionFailed, "Container ID #{state[:container_id]} was found in the kitchen state data, " \
"but the container does not exist."
end

Expand Down
25 changes: 9 additions & 16 deletions lib/kitchen/docker/helpers/container_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def create_dir_on_container(state, path)
cmd = "mkdir -p #{path}"

if state[:platform].include?("windows")
psh = "-Command if(-not (Test-Path \'#{path}\')) { New-Item -Path \'#{path}\' -Force }"
psh = "-Command if(-not (Test-Path '#{path}')) { New-Item -Path '#{path}' -Force }"
cmd = build_powershell_command(psh)
end

Expand Down Expand Up @@ -151,23 +151,16 @@ def remove_container(state)
end

def dockerfile_proxy_config
env_variables = ""
if config[:http_proxy]
env_variables << "ENV http_proxy=#{config[:http_proxy]}\n"
env_variables << "ENV HTTP_PROXY=#{config[:http_proxy]}\n"
end

if config[:https_proxy]
env_variables << "ENV https_proxy=#{config[:https_proxy]}\n"
env_variables << "ENV HTTPS_PROXY=#{config[:https_proxy]}\n"
end
%i{http_proxy https_proxy no_proxy}.map do |proxy_type|
proxy_env_vars(proxy_type)
end.join
end

if config[:no_proxy]
env_variables << "ENV no_proxy=#{config[:no_proxy]}\n"
env_variables << "ENV NO_PROXY=#{config[:no_proxy]}\n"
end
def proxy_env_vars(proxy_type)
return "" unless config[proxy_type]

env_variables
value = config[proxy_type]
"ENV #{proxy_type}=#{value}\nENV #{proxy_type.upcase}=#{value}\n"
end
end
# rubocop:enable Metrics/ModuleLength, Style/Documentation
Expand Down
4 changes: 2 additions & 2 deletions lib/kitchen/docker/helpers/image_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def build_image(state, dockerfile)
file.write(dockerfile)
file.close
docker_command("#{cmd} #{build_context}",
input: dockerfile_contents,
environment: { BUILDKIT_PROGRESS: "plain" })
input: dockerfile_contents,
environment: { BUILDKIT_PROGRESS: "plain" })
ensure
file.close unless file.closed?
file.unlink
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/driver/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Docker < Kitchen::Driver::Base
"ping -t localhost"
end
else
"/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes "\
"/usr/sbin/sshd -D -o UseDNS=no -o UsePAM=no -o PasswordAuthentication=yes " \
"-o UsePrivilegeSeparation=no -o PidFile=/tmp/sshd.pid"
end
end
Expand Down
Loading