kitchen-dokken 2.16.0 → 2.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c1eb7ea3b8b7026368f17e936583541737f204457ac3717a1d30107635330f9
4
- data.tar.gz: 2606b5d2255543272111230715c7b6a050e3e58b7957d6335265d884059e52db
3
+ metadata.gz: 0b2d590af89b1fde3cb1a0d5a5d681abbd377462aaa0cde0b2b7809802db21e1
4
+ data.tar.gz: 92983e5510abd9b522fc7a046d62d56637f56c321504ad5d0691f21e8e2db4dd
5
5
  SHA512:
6
- metadata.gz: 5c91016a21ae59923337c4e91fb61ef3920918da3340b24427392b325a812d016727c98482409eaeee9c825074a3b5559e669c4bc4ac5e67bd5bf5b6fdf43347
7
- data.tar.gz: 388e6ba61fc2c4d2ba88e28780e4b541dc7dffe426f4250d7a6a99b52bbb1c0c98f6c9ae6bc306bdd640273b41f2852e83a851556d5a226aa1912bc4a04f02ff
6
+ metadata.gz: fa71281c52fc0e3004fd5a243e9c595a76648a5038d0fa8f2bb842a05d4b9ea34c2c7666b48d297882243241687d837eeae04fc8a75f33a98dfa50971e252f41
7
+ data.tar.gz: 722f40d25fc652b26c353a81262d769ebfff3159317b38b7f7c1f8111fd8585d335970261646dd4092fad3aa6d860698f116ca5f71946f2ebaa1b97700bbffbc
@@ -66,9 +66,13 @@ module Kitchen
66
66
  default_config :userns_host, false
67
67
  default_config :volumes, nil
68
68
  default_config :write_timeout, 3600
69
+ default_config :creds_file, nil
69
70
 
70
71
  # (see Base#create)
71
72
  def create(state)
73
+ # Authenticate the private registry
74
+ authenticate!
75
+
72
76
  # image to config
73
77
  pull_platform_image
74
78
 
@@ -410,6 +414,21 @@ module Kitchen
410
414
  end
411
415
  end
412
416
 
417
+ def authenticate!
418
+ # No need to authenticate if the credentials are empty
419
+ return if docker_creds.empty?
420
+
421
+ ::Docker.authenticate! docker_creds
422
+ end
423
+
424
+ def docker_creds
425
+ @docker_creds ||= if config[:creds_file]
426
+ JSON.parse(IO.read(config[:creds_file]))
427
+ else
428
+ {}
429
+ end
430
+ end
431
+
413
432
  def pull_platform_image
414
433
  debug "driver - pulling #{short_image_path(platform_image)}"
415
434
  config[:pull_platform_image] ? pull_image(platform_image) : pull_if_missing(platform_image)
@@ -602,7 +621,7 @@ module Kitchen
602
621
  original_image = Docker::Image.get(path, {}, docker_connection)
603
622
  end
604
623
 
605
- new_image = Docker::Image.create({ "fromImage" => path }, {}, docker_connection)
624
+ new_image = Docker::Image.create({ "fromImage" => path }, docker_creds, docker_connection)
606
625
 
607
626
  !(original_image && original_image.id.start_with?(new_image.id))
608
627
  end
@@ -18,6 +18,6 @@
18
18
  module Kitchen
19
19
  module Driver
20
20
  # Version string for Dokken Kitchen driver
21
- DOKKEN_VERSION = "2.16.0".freeze
21
+ DOKKEN_VERSION = "2.17.0".freeze
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dokken
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.0
4
+ version: 2.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-23 00:00:00.000000000 Z
11
+ date: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.2.22
100
+ rubygems_version: 3.2.32
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: A Test Kitchen Driver for Docker & Chef Infra optimized for rapid testing