beaker-docker 2.2.0 → 2.2.1
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/beaker/hypervisor/docker.rb +3 -3
- data/lib/beaker-docker/version.rb +1 -1
- data/spec/beaker/hypervisor/docker_spec.rb +35 -47
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6264189ab77d7c85932a5e565c593365f07450b25d38796e1349c5304754b7cc
|
4
|
+
data.tar.gz: fa7f1dcde6a3b11121972a67a91c2c365db17f0ea2e22e36777cef1b07cb88c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0d8b74a89100b457d1beed90cf9f53e33c93ca891b8c377ee795a06fc261154ee5fd9c88eddc5c68b6517d4129961109e874eac2925ca56907962cd26ad2d6
|
7
|
+
data.tar.gz: 4af9b0bd85a33e02c078f743fd9eeeacaed4862e8dfc3f4497713a0dbd630658fb68100a8fdad8d0e7022dfa998f34a57f55c727b0e1b2264fcdb7337ad23109
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.2.1](https://github.com/voxpupuli/beaker-docker/tree/2.2.1) (2024-03-27)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/2.2.0...2.2.1)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Fix privileged remote docker port forward resolution [\#126](https://github.com/voxpupuli/beaker-docker/pull/126) ([h0tw1r3](https://github.com/h0tw1r3))
|
10
|
+
|
3
11
|
## [2.2.0](https://github.com/voxpupuli/beaker-docker/tree/2.2.0) (2024-03-17)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/voxpupuli/beaker-docker/compare/2.1.0...2.2.0)
|
@@ -188,9 +188,9 @@ module Beaker
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
|
191
|
-
if host_config['NetworkMode'] != 'slirp4netns' && network_settings['IPAddress'] && !network_settings['IPAddress'].empty?
|
192
|
-
|
193
|
-
|
191
|
+
ip = network_settings['IPAddress'] if ip.nil? && host_config['NetworkMode'] != 'slirp4netns' && network_settings['IPAddress'] && !network_settings['IPAddress'].empty?
|
192
|
+
|
193
|
+
if port.nil?
|
194
194
|
port22 = network_settings.dig('Ports', '22/tcp')
|
195
195
|
port = port22[0]['HostPort'] if port22
|
196
196
|
end
|
@@ -110,6 +110,12 @@ module Beaker
|
|
110
110
|
|
111
111
|
before do
|
112
112
|
allow(::Docker).to receive(:rootless?).and_return(true)
|
113
|
+
@docker_host = ENV.fetch('DOCKER_HOST', nil)
|
114
|
+
ENV.delete('DOCKER_HOST') if @docker_host
|
115
|
+
end
|
116
|
+
|
117
|
+
after do
|
118
|
+
ENV['DOCKER_HOST'] = @docker_host if @docker_host
|
113
119
|
end
|
114
120
|
|
115
121
|
context 'with connection failure' do
|
@@ -476,64 +482,46 @@ module Beaker
|
|
476
482
|
end
|
477
483
|
|
478
484
|
context 'when connecting to ssh' do
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
it 'exposes port 22 to beaker' do
|
485
|
-
ENV['DOCKER_HOST'] = nil
|
486
|
-
docker.provision
|
487
|
-
|
488
|
-
expect(hosts[0]['ip']).to eq '127.0.0.1'
|
489
|
-
expect(hosts[0]['port']).to eq 8022
|
490
|
-
end
|
491
|
-
|
492
|
-
it 'exposes port 22 to beaker when using DOCKER_HOST' do
|
493
|
-
ENV['DOCKER_HOST'] = 'tcp://192.0.2.2:2375'
|
494
|
-
docker.provision
|
495
|
-
|
496
|
-
expect(hosts[0]['ip']).to eq '192.0.2.2'
|
497
|
-
expect(hosts[0]['port']).to eq 8022
|
498
|
-
end
|
485
|
+
%w[rootless privileged].each do |mode|
|
486
|
+
context "when #{mode}" do
|
487
|
+
let(:container_mode) do
|
488
|
+
mode
|
489
|
+
end
|
499
490
|
|
500
|
-
|
501
|
-
|
502
|
-
docker.provision
|
491
|
+
it 'exposes port 22 to beaker' do
|
492
|
+
docker.provision
|
503
493
|
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
expect(hosts[0]['ssh'][:port]).to eq 8022
|
508
|
-
expect(hosts[0]['ssh'][:forward_agent]).to be true
|
509
|
-
end
|
494
|
+
expect(hosts[0]['ip']).to eq '127.0.0.1'
|
495
|
+
expect(hosts[0]['port']).to eq 8022
|
496
|
+
end
|
510
497
|
|
511
|
-
|
512
|
-
|
513
|
-
FileUtils.touch('/.dockerenv')
|
498
|
+
it 'exposes port 22 to beaker when using DOCKER_HOST' do
|
499
|
+
ENV['DOCKER_HOST'] = 'tcp://192.0.2.2:2375'
|
514
500
|
docker.provision
|
515
501
|
|
516
|
-
expect(hosts[0]['ip']).to eq '192.0.2.
|
502
|
+
expect(hosts[0]['ip']).to eq '192.0.2.2'
|
517
503
|
expect(hosts[0]['port']).to eq 8022
|
518
504
|
end
|
519
|
-
end
|
520
|
-
end
|
521
|
-
|
522
|
-
context 'when rootful' do
|
523
|
-
before { @docker_host = ENV.fetch('DOCKER_HOST', nil) }
|
524
505
|
|
525
|
-
|
506
|
+
it 'has ssh agent forwarding enabled' do
|
507
|
+
docker.provision
|
526
508
|
|
527
|
-
|
528
|
-
|
529
|
-
|
509
|
+
expect(hosts[0]['ip']).to eq '127.0.0.1'
|
510
|
+
expect(hosts[0]['port']).to eq 8022
|
511
|
+
expect(hosts[0]['ssh'][:password]).to eq 'root'
|
512
|
+
expect(hosts[0]['ssh'][:port]).to eq 8022
|
513
|
+
expect(hosts[0]['ssh'][:forward_agent]).to be true
|
514
|
+
end
|
530
515
|
|
531
|
-
|
532
|
-
|
533
|
-
|
516
|
+
it 'connects to gateway ip' do
|
517
|
+
FakeFS do
|
518
|
+
FileUtils.touch('/.dockerenv')
|
519
|
+
docker.provision
|
534
520
|
|
535
|
-
|
536
|
-
|
521
|
+
expect(hosts[0]['ip']).to eq '192.0.2.254'
|
522
|
+
expect(hosts[0]['port']).to eq 8022
|
523
|
+
end
|
524
|
+
end
|
537
525
|
end
|
538
526
|
end
|
539
527
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-03-
|
14
|
+
date: 2024-03-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fakefs
|