beaker-docker 3.1.0 → 3.1.2

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: 32bbe60ffa590b3dadc093f098b34513b036bb104f4f8017a9ad233127974a02
4
- data.tar.gz: 1ba3e290c1c18be4ae5d66baa5cbfd5d99b77b5d57213e50868b5bf940568793
3
+ metadata.gz: 06f9fc450f23708d94b3a68993497c7f9f71fa60772b8b78ca7eb5ddd7668416
4
+ data.tar.gz: abb226ed9841f2d44801729924e6ed38f2c4dfe8067b2379875d21006e04442c
5
5
  SHA512:
6
- metadata.gz: 8693d6608fa81f4c21e71ad011a2c50a427e7304a445cb19aeb7f9c54c817310f3e13ac1114d84ff8bdc3446ae7f255ca97d794ca0134d73013a8de94fdb5b01
7
- data.tar.gz: 0137e77889c7570d3338d7a24bafe0861ba37cb72b8944577ad6c4b7e1c0ec3d0487e679e203110d4ab9144e62187561f03a94f7cce91e22ef42cdd56b539c50
6
+ metadata.gz: 3cb84d39f6f5781dffb3fa7e4f90c22d6289d4a2f94813eabc68fcc189ad751d16640b79b6d102347908167eb72bbe07a721519a9598939a1e1302ebd1328da2
7
+ data.tar.gz: f5fb1783aead6963196fa14e3a73195ace14d8f80504e0e7036d05e3b0e8243d4d81961dca38506db2554e581f8c57a166178fe1f652625b165bb787eb3264cb
@@ -24,7 +24,7 @@ jobs:
24
24
  shell: bash
25
25
  run: gem build --verbose *.gemspec
26
26
  - name: Upload gem to GitHub cache
27
- uses: actions/upload-artifact@v6
27
+ uses: actions/upload-artifact@v7
28
28
  with:
29
29
  name: gem-artifact
30
30
  path: '*.gem'
@@ -39,7 +39,7 @@ jobs:
39
39
  contents: write # clone repo and create release
40
40
  steps:
41
41
  - name: Download gem from GitHub cache
42
- uses: actions/download-artifact@v7
42
+ uses: actions/download-artifact@v8
43
43
  with:
44
44
  name: gem-artifact
45
45
  - name: Create Release
@@ -56,7 +56,7 @@ jobs:
56
56
  packages: write # publish to rubygems.pkg.github.com
57
57
  steps:
58
58
  - name: Download gem from GitHub cache
59
- uses: actions/download-artifact@v7
59
+ uses: actions/download-artifact@v8
60
60
  with:
61
61
  name: gem-artifact
62
62
  - name: Publish gem to GitHub packages
@@ -73,7 +73,7 @@ jobs:
73
73
  id-token: write # rubygems.org authentication
74
74
  steps:
75
75
  - name: Download gem from GitHub cache
76
- uses: actions/download-artifact@v7
76
+ uses: actions/download-artifact@v8
77
77
  with:
78
78
  name: gem-artifact
79
79
  - uses: rubygems/configure-rubygems-credentials@v1.0.0
@@ -92,7 +92,7 @@ jobs:
92
92
  - release-to-rubygems
93
93
  steps:
94
94
  - name: Download gem from GitHub cache
95
- uses: actions/download-artifact@v7
95
+ uses: actions/download-artifact@v8
96
96
  with:
97
97
  name: gem-artifact
98
98
  - name: Install Ruby
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.2](https://github.com/voxpupuli/beaker-docker/tree/3.1.2) (2026-02-27)
4
+
5
+ [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/3.1.1...3.1.2)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - fix: complete the support for docker-ce \>= v29 network configuration [\#183](https://github.com/voxpupuli/beaker-docker/pull/183) ([mxey](https://github.com/mxey))
10
+ - Handle empty IPAddress when setting host vm\_ip [\#182](https://github.com/voxpupuli/beaker-docker/pull/182) ([uvNikita](https://github.com/uvNikita))
11
+
12
+ ## [3.1.1](https://github.com/voxpupuli/beaker-docker/tree/3.1.1) (2026-01-31)
13
+
14
+ [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/3.1.0...3.1.1)
15
+
16
+ **Fixed bugs:**
17
+
18
+ - Handle both podman and docker to get SUT container IP address [\#180](https://github.com/voxpupuli/beaker-docker/pull/180) ([alelindq](https://github.com/alelindq))
19
+
3
20
  ## [3.1.0](https://github.com/voxpupuli/beaker-docker/tree/3.1.0) (2025-12-27)
4
21
 
5
22
  [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/3.0.1...3.1.0)
@@ -151,6 +151,10 @@ module Beaker
151
151
  elsif in_container? && !nested_docker?
152
152
  # Swarm or local docker host
153
153
  gw = network_settings['Gateway']
154
+
155
+ # also handle scenarios where network_settings['Gateway'] is not set (e.g. docker-ce >= v29)
156
+ gw = network_settings['Networks'][host_config['NetworkMode']]['Gateway'] if gw.nil? || gw.empty?
157
+
154
158
  ip = gw unless gw.nil? || gw.empty?
155
159
  else
156
160
  # The many faces of container networking
@@ -164,7 +168,9 @@ module Beaker
164
168
 
165
169
  # Container to container
166
170
  unless ip && port
167
- ip = network_settings['IPAddress']
171
+ ip = network_settings['IPAddress'] # podman
172
+ # also handle scenarios where network_settings['IPAddress'] is not set (e.g. docker-ce >= v29)
173
+ ip = network_settings['Networks'][host_config['NetworkMode']]['IPAddress'] if ip.nil? || ip.empty?
168
174
  port = (ip && !ip.empty?) ? 22 : nil
169
175
  end
170
176
 
@@ -354,7 +360,11 @@ module Beaker
354
360
  @logger.debug("node available as ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@#{ip} -p #{port}")
355
361
  host['docker_container_id'] = container.id
356
362
  host['docker_image_id'] = image.id
357
- host['vm_ip'] = container.json['NetworkSettings']['IPAddress'].to_s
363
+ host_config = container.json['HostConfig']
364
+ vm_ip = container.json['NetworkSettings']['IPAddress']
365
+ # handle scenarios where network_settings['IPAddress'] is not set (e.g. docker-ce >= v29)
366
+ vm_ip = container.json['NetworkSettings']['Networks'][host_config['NetworkMode']]['IPAddress'] if vm_ip.nil? || vm_ip.empty?
367
+ host['vm_ip'] = vm_ip.to_s
358
368
 
359
369
  def host.reboot
360
370
  @logger.warn('Rebooting containers is ineffective...ignoring')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeakerDocker
4
- VERSION = '3.1.0'
4
+ VERSION = '3.1.2'
5
5
  end
@@ -688,6 +688,57 @@ module Beaker
688
688
  end
689
689
  end
690
690
  end
691
+
692
+ context 'when using newer docker-ce where IPs are only in Networks' do
693
+ let(:container_config) do
694
+ {
695
+ 'HostConfig' => {
696
+ 'NetworkMode' => 'bridge',
697
+ },
698
+ 'NetworkSettings' => {
699
+ 'Ports' => {
700
+ '22/tcp' => [
701
+ {
702
+ 'HostIp' => '0.0.0.0',
703
+ 'HostPort' => 8022,
704
+ },
705
+ ],
706
+ },
707
+ 'Networks' => {
708
+ 'bridge' => {
709
+ 'Gateway' => '192.0.2.254',
710
+ 'IPAddress' => '192.0.2.10',
711
+ },
712
+ },
713
+ },
714
+ }
715
+ end
716
+
717
+ it 'falls back to Networks[NetworkMode][IPAddress]' do
718
+ ENV['DOCKER_IN_DOCKER'] = 'true'
719
+ FakeFS do
720
+ FileUtils.touch('/.dockerenv')
721
+ docker.provision
722
+
723
+ expect(hosts[0]['ip']).to eq '192.0.2.10'
724
+ expect(hosts[0]['port']).to eq 22
725
+ expect(hosts[0]['vm_ip']).to eq '192.0.2.10'
726
+ end
727
+ end
728
+
729
+ it 'stills finds gateway' do
730
+ ENV['DOCKER_IN_DOCKER'] = nil
731
+ ENV['DOCKER_HOST'] = nil
732
+ FakeFS do
733
+ FileUtils.touch('/.dockerenv')
734
+ docker.provision
735
+
736
+ expect(hosts[0]['ip']).to eq '192.0.2.254'
737
+ expect(hosts[0]['port']).to eq 8022
738
+ expect(hosts[0]['vm_ip']).to eq '192.0.2.10'
739
+ end
740
+ end
741
+ end
691
742
  end
692
743
 
693
744
  it 'generates a new /etc/hosts file referencing each host' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli