beaker-docker 3.1.1 → 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: 20458b7863defa8965bb32ebf8509c39cb8879b6a3d77c738fe76c55ad80b7b0
4
- data.tar.gz: de353c5f2b2a75edefed8e4926eeb07792717173db68cfa3081fa5e747920a17
3
+ metadata.gz: 06f9fc450f23708d94b3a68993497c7f9f71fa60772b8b78ca7eb5ddd7668416
4
+ data.tar.gz: abb226ed9841f2d44801729924e6ed38f2c4dfe8067b2379875d21006e04442c
5
5
  SHA512:
6
- metadata.gz: b17e5c8962e810565652fd962a7240c2d328e3ac08793da48416040fa7b4351863b85d0e0043518c57e1b31db7cd5c433103e394bc262504fae6f7d42485c4f2
7
- data.tar.gz: 38928914ecb2b8b5bbfc9fff9dacfce07a852d0c937e22b5ebea97dcccba77a7442ca0c9c61ad23bd0b224a6c26037cf2f9b08e34a984c39fe0aa3207b5e4e30
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,14 @@
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
+
3
12
  ## [3.1.1](https://github.com/voxpupuli/beaker-docker/tree/3.1.1) (2026-01-31)
4
13
 
5
14
  [Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/3.1.0...3.1.1)
@@ -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
@@ -356,7 +360,11 @@ module Beaker
356
360
  @logger.debug("node available as ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@#{ip} -p #{port}")
357
361
  host['docker_container_id'] = container.id
358
362
  host['docker_image_id'] = image.id
359
- 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
360
368
 
361
369
  def host.reboot
362
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.1'
4
+ VERSION = '3.1.2'
5
5
  end
@@ -689,14 +689,13 @@ module Beaker
689
689
  end
690
690
  end
691
691
 
692
- context 'when IPAddress is empty but available in Networks' do
692
+ context 'when using newer docker-ce where IPs are only in Networks' do
693
693
  let(:container_config) do
694
694
  {
695
695
  'HostConfig' => {
696
696
  'NetworkMode' => 'bridge',
697
697
  },
698
698
  'NetworkSettings' => {
699
- 'IPAddress' => '',
700
699
  'Ports' => {
701
700
  '22/tcp' => [
702
701
  {
@@ -705,9 +704,9 @@ module Beaker
705
704
  },
706
705
  ],
707
706
  },
708
- 'Gateway' => '192.0.2.254',
709
707
  'Networks' => {
710
708
  'bridge' => {
709
+ 'Gateway' => '192.0.2.254',
711
710
  'IPAddress' => '192.0.2.10',
712
711
  },
713
712
  },
@@ -723,6 +722,20 @@ module Beaker
723
722
 
724
723
  expect(hosts[0]['ip']).to eq '192.0.2.10'
725
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'
726
739
  end
727
740
  end
728
741
  end
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.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli