kuby-kind 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -0
- data/Rakefile +1 -0
- data/lib/kuby/kind/provider.rb +37 -3
- data/lib/kuby/kind/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a39079aa851aca0e7bb1299217ae79a4a90e3f3e196f9073aace12ad8d3a9c
|
4
|
+
data.tar.gz: c557e2b0f80a4341695b0e4fec0ff6b45b664e959eb4655d82be426f18ed4396
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc2e7b389bf33d058a035b8f55370fe52b552473fd8271cd8959707c9a63c1e905d19e2a67feba68e3a118e495297d69b2768c0af8e70ca330d95072987736fc
|
7
|
+
data.tar.gz: 39c1ed244dec0bb577021e6e1dd4dd66e7c909387032e2c7620e899c71403e2270b28a986f1dffba144c48f4aa76d5f0f8e65aba38bcdfa2742bca42b3d0c821
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.2.3
|
2
|
+
* Remove mistakenly added `require 'pry-byebug'` 🤦
|
3
|
+
|
4
|
+
## 0.2.2
|
5
|
+
* Add missing 'require'.
|
6
|
+
|
1
7
|
## 0.2.1
|
2
8
|
* Only create cluster and load images on deploy.
|
3
9
|
- Uses the `deploy` hook instead of `before_deploy`, which is called during `kuby resources` used to simulate a deploy so tag info is populated correctly.
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/kuby/kind/provider.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'kuby'
|
2
2
|
require 'kind-rb'
|
3
3
|
require 'open3'
|
4
|
+
require 'tmpdir'
|
4
5
|
|
5
6
|
module Kuby
|
6
7
|
module Kind
|
@@ -64,12 +65,41 @@ module Kuby
|
|
64
65
|
def load_images
|
65
66
|
Kuby.logger.info("Loading Docker images into Kind cluster...")
|
66
67
|
|
68
|
+
node_name = "#{cluster_name}-control-plane"
|
69
|
+
loaded_images = YAML.load(
|
70
|
+
docker_cli.exec_capture(
|
71
|
+
container: node_name,
|
72
|
+
command: '/usr/local/bin/crictl images --digests -o yaml'
|
73
|
+
)
|
74
|
+
)
|
75
|
+
|
76
|
+
loaded_digests = loaded_images['images'].map do |image|
|
77
|
+
algo, digest = image['id'].split(':')
|
78
|
+
{ algo: algo, digest: digest }
|
79
|
+
end
|
80
|
+
|
67
81
|
environment.kubernetes.docker_images.each do |image|
|
68
82
|
image = image.current_version
|
69
83
|
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
84
|
+
# Avoid loading images into the cluster if they're already there. Kind tries to detect this
|
85
|
+
# on its own and will even emit log messages to that effect, but appears to load them
|
86
|
+
# anyway. Since loading images can be quite time-consuming, we do our own check below.
|
87
|
+
images = docker_cli.images(image.image_url, digests: true)
|
88
|
+
image_info = images.find { |img| img[:tag] == image.main_tag }
|
89
|
+
|
90
|
+
if image_info
|
91
|
+
algo, _ = image_info[:digest].split(':')
|
92
|
+
|
93
|
+
loaded_digest = loaded_digests.find do |loaded_digest|
|
94
|
+
algo == loaded_digest[:algo] && loaded_digest[:digest].start_with?(image_info[:id])
|
95
|
+
end
|
96
|
+
|
97
|
+
if loaded_digest
|
98
|
+
Kuby.logger.info("Skipping #{image.image_url}@#{loaded_digest[:algo]}:#{loaded_digest[:digest]} because it's already loaded.")
|
99
|
+
next
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
73
103
|
cmd = [
|
74
104
|
KindRb.executable,
|
75
105
|
'load', 'docker-image', "#{image.image_url}:#{image.main_tag}",
|
@@ -213,6 +243,10 @@ module Kuby
|
|
213
243
|
Dir.tmpdir, 'kuby-kind'
|
214
244
|
)
|
215
245
|
end
|
246
|
+
|
247
|
+
def docker_cli
|
248
|
+
@docker_cli ||= Docker::CLI.new
|
249
|
+
end
|
216
250
|
end
|
217
251
|
end
|
218
252
|
end
|
data/lib/kuby/kind/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuby-kind
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kuby-core
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
82
|
+
rubygems_version: 3.4.5
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Kind provider for Kuby.
|