kitchen-docker 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfc2ec595062530ef1a860930cb80cbdfd1f2d9b0f23f1bd7d261e769679b3a1
4
- data.tar.gz: 51b9b8e5f65991cd5dfb26d719301ae55e90d94b2591671617396b993d0c614b
3
+ metadata.gz: 5d65a3c6ae8fbb16e1fd87e4553a177ccaebc45fbaef3e92e0126b3fc46c2634
4
+ data.tar.gz: cf847bf5d538fdd037fdd8c446cd9242b29504c413a4a3be502e24b76b14ef60
5
5
  SHA512:
6
- metadata.gz: 2149ff5a8af75c70e88b93d03f5431e1586d7e0d69d117d742ec591e76fb9aca96b9d8c76e4e9d937c8c398daa4a641d0089c608a6bea9762a0c48b5b9708590
7
- data.tar.gz: 6e235534cf2f6ec24dc9cc3e59c10048fe874684c0488dcd15c5ffe0c9409491b27c40683a5945ad5cd857b6c03c72d8d0b90b0446069a0583068aebb5ae5cce
6
+ metadata.gz: 93d76bf32eaee907b3e284b5dafc2c7e85a2198c2626078b5ba6f85d922157fdbefd3a0d5cfdeaa01bdcd181bee16d1c7fc9ef5ea286fd2624b0c4573703bdb5
7
+ data.tar.gz: f3a4428581c76cf40eecbce6ecda3a207d72f0dff17788b6f9f0059bad59660955fe2cfe0ac4ffed5b1b933967c044e2889a52d9c8aeb50fa6480077c003c4cf
data/.kitchen.yml CHANGED
@@ -22,7 +22,6 @@ platforms:
22
22
  - yum install libxcrypt-compat -y
23
23
  - curl -L https://www.chef.io/chef/install.sh | bash
24
24
  - name: centos-7
25
- - name: centos-8
26
25
  - name: oraclelinux-7
27
26
  - name: rockylinux-8
28
27
  - name: debian-9
@@ -39,13 +38,13 @@ platforms:
39
38
 
40
39
  suites:
41
40
  - name: default
42
- excludes: [arch]
41
+ excludes: [arch, debian-9]
43
42
  - name: context
44
- excludes: [arch]
43
+ excludes: [arch, debian-9]
45
44
  driver:
46
45
  build_context: false
47
46
  - name: capabilities
48
- includes: [debian-9,debian-10,ubuntu-18.04,ubuntu-20.04]
47
+ includes: [debian-10,ubuntu-18.04,ubuntu-20.04]
49
48
  driver:
50
49
  provision_command:
51
50
  - curl -L https://www.chef.io/chef/install.sh | bash
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Kitchen-Docker Changelog
2
2
 
3
+ ## 2.14.0 - November 13, 2023
4
+
5
+ - Make sure the /etc/sudoers.d directory exists by @garethgreenaway in [#397](https://github.com/test-kitchen/kitchen-docker/pull/397)
6
+ - Breaking almalinux platform out by @garethgreenaway [#398](https://github.com/test-kitchen/kitchen-docker/pull/398)
7
+ - fix: parse_image_id: Process "docker build" output in reverse line order by @terminalmage in [#400](https://github.com/test-kitchen/kitchen-docker/pull/400)
8
+ - Allow build temporary Dockerfile in configured custom_dir by @Val in [294](https://github.com/test-kitchen/kitchen-docker/pull/294)
9
+
10
+ ## 2.13.0 - June 10, 2022
11
+
12
+ - Added CentOSStream and PhotonOS - [@garethgreenaway](https://github.com/garethgreenaway)
13
+ - Fixed image parser when output includes a duration timestamp - [@RulerOf](https://github.com/RulerOf)
14
+ - Updated the test suites - [@RulerOf](https://github.com/RulerOf)
15
+
3
16
  ## 2.12.0 - December 22, 2021
4
17
 
5
18
  - Support Docker BuildKit - [@RulerOf](https://github.com/RulerOf)
data/README.md CHANGED
@@ -583,6 +583,16 @@ Examples:
583
583
  net: br3
584
584
  ```
585
585
 
586
+ ### build_tempdir
587
+
588
+ Relative (to `build_context`) temporary directory path for built Dockerfile.
589
+
590
+ Example:
591
+
592
+ ```yaml
593
+ build_tempdir: .kitchen
594
+ ```
595
+
586
596
  ### use_internal_docker_network
587
597
 
588
598
  If you want to use kitchen-docker from within another Docker container you'll
@@ -16,6 +16,6 @@
16
16
  module Kitchen
17
17
  module Docker
18
18
  # Version string for Docker Kitchen driver
19
- DOCKER_VERSION = "2.12.0"
19
+ DOCKER_VERSION = "2.14.0"
20
20
  end
21
21
  end
@@ -34,8 +34,14 @@ module Kitchen
34
34
  gentoo_paludis_platform
35
35
  when 'opensuse/tumbleweed', 'opensuse/leap', 'opensuse', 'sles'
36
36
  opensuse_platform
37
- when 'rhel', 'centos', 'oraclelinux', 'amazonlinux', 'almalinux', 'rockylinux'
37
+ when 'rhel', 'centos', 'oraclelinux', 'amazonlinux', 'rockylinux'
38
38
  rhel_platform
39
+ when 'centosstream'
40
+ centosstream_platform
41
+ when 'almalinux'
42
+ almalinux_platform
43
+ when 'photon'
44
+ photonos_platform
39
45
  else
40
46
  raise ActionFailed, "Unknown platform '#{config[:platform]}'"
41
47
  end
@@ -114,11 +120,43 @@ module Kitchen
114
120
  CODE
115
121
  end
116
122
 
123
+ def centosstream_platform
124
+ <<-CODE
125
+ ENV container docker
126
+ RUN yum clean all
127
+ RUN yum install -y sudo openssh-server openssh-clients which
128
+ RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
129
+ RUN [ -f "/etc/ssh/ssh_host_dsa_key" ] || ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
130
+ CODE
131
+ end
132
+
133
+ def almalinux_platform
134
+ <<-CODE
135
+ ENV container docker
136
+ RUN yum clean all
137
+ RUN yum install -y sudo openssh-server openssh-clients which
138
+ RUN [ -f "/etc/ssh/ssh_host_rsa_key" ] || ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
139
+ RUN [ -f "/etc/ssh/ssh_host_dsa_key" ] || ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
140
+ CODE
141
+ end
142
+
143
+ def photonos_platform
144
+ <<-CODE
145
+ ENV container docker
146
+ RUN tdnf clean all
147
+ RUN tdnf install -y sudo openssh-server openssh-clients which curl
148
+ RUN [ -f "/etc/ssh/ssh_host_ecdsa_key" ] || ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
149
+ RUN [ -f "/etc/ssh/ssh_host_ed25519_key" ] || ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
150
+ CODE
151
+ end
152
+
117
153
  def dockerfile_base_linux(username, homedir)
118
154
  <<-CODE
119
155
  RUN if ! getent passwd #{username}; then \
120
156
  useradd -d #{homedir} -m -s /bin/bash -p '*' #{username}; \
121
157
  fi
158
+ RUN mkdir -p /etc/sudoers.d
159
+ RUN chmod 0750 /etc/sudoers.d
122
160
  RUN echo "#{username} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/#{username}
123
161
  RUN echo "Defaults !requiretty" >> /etc/sudoers.d/#{username}
124
162
  RUN mkdir -p #{homedir}/.ssh
@@ -13,6 +13,7 @@
13
13
 
14
14
  require 'kitchen'
15
15
  require 'kitchen/configurable'
16
+ require 'pathname'
16
17
  require_relative 'cli_helper'
17
18
  require_relative 'container_helper'
18
19
 
@@ -25,9 +26,9 @@ module Kitchen
25
26
  include Kitchen::Docker::Helpers::ContainerHelper
26
27
 
27
28
  def parse_image_id(output)
28
- output.each_line do |line|
29
- if line =~ /writing image sha256:[[:xdigit:]]{64} done/i
30
- img_id = line[/writing image (sha256:[[:xdigit:]]{64}) done/i,1]
29
+ output.split("\n").reverse_each do |line|
30
+ if line =~ /writing image (sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i
31
+ img_id = line[/writing image (sha256:[[:xdigit:]]{64})(?: \d*\.\ds)? done/i,1]
31
32
  return img_id
32
33
  end
33
34
  if line =~ /image id|build successful|successfully built/i
@@ -50,7 +51,7 @@ module Kitchen
50
51
  extra_build_options = config_to_options(config[:build_options])
51
52
  cmd << " #{extra_build_options}" unless extra_build_options.empty?
52
53
  dockerfile_contents = dockerfile
53
- file = Tempfile.new('Dockerfile-kitchen', Dir.pwd)
54
+ file = Tempfile.new('Dockerfile-kitchen', Pathname.pwd + config[:build_tempdir])
54
55
  cmd << " -f #{Shellwords.escape(dockerfile_path(file))}" if config[:build_context]
55
56
  build_context = config[:build_context] ? '.' : '-'
56
57
  output = begin
@@ -37,6 +37,7 @@ module Kitchen
37
37
 
38
38
  default_config :binary, 'docker'
39
39
  default_config :build_options, nil
40
+ default_config :build_tempdir, Dir.pwd
40
41
  default_config :cap_add, nil
41
42
  default_config :cap_drop, nil
42
43
  default_config :disable_upstart, true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2023-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  - !ruby/object:Gem::Version
267
267
  version: '0'
268
268
  requirements: []
269
- rubygems_version: 3.2.32
269
+ rubygems_version: 3.4.10
270
270
  signing_key:
271
271
  specification_version: 4
272
272
  summary: A Docker Driver for Test Kitchen