kuber_kit 0.2.1 → 0.2.2

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: d669438926fb5a86f3ca7fff7f37226330cdcc4f581e590ff8ef9720eae9134c
4
- data.tar.gz: 5ce659015d98f83c07ad3e643b70ffadb729722712c88c32364a9f9668b4717e
3
+ metadata.gz: 2164864d55b65ebdd1c62b766b16b3837ad7c3f676380a58b6f60b492b9eb0cd
4
+ data.tar.gz: 4517a27f92f73b1732bc7e7c200a0a6e037523fe07c6652f06f534a10266e0f8
5
5
  SHA512:
6
- metadata.gz: a3966b99289899afb257091b11424ba5a0c56d9c5f4385bcb519de32a37355445554922468070cc7520fbfc727435d8b0b41dd8f5cb73f097c6ffe3baf0a9f3f
7
- data.tar.gz: 1343042958b0e71cd5091db62b9646ad43e027833b2bd8df7cf742b1f73065992071e208110bb95a0020e2a66b00d8c12a8a91dd090cbd2bb195114dde3a68cc
6
+ metadata.gz: 919f25e6aac48e750283df32a25a29a56e9c0111fefd7be084d9382478a79348a8072c381ee4f2a8bd95fc1f77ea3b7345904d1d260d4a1ee6820f131f453cd6
7
+ data.tar.gz: 441083ec69f68ad88e806c0e7ad95ad16a91547140f8649949187c088f778e1055c5e42c3b2813f9d4ff7557bacbdc65bb0ed3becdab36e5c7ffdc079d36eaea
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.2.1)
4
+ kuber_kit (0.2.2)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
@@ -4,12 +4,15 @@ class KuberKit::ImageCompiler::BuildServerPool
4
4
  def initialize(local_shell:, build_servers:, ssh_shell_class:)
5
5
  @local_shell = local_shell
6
6
  @ssh_shell_class = ssh_shell_class
7
- @ssh_shells = connect_to_ssh_shells(build_servers)
7
+ @build_servers = build_servers
8
+ @ssh_shells = []
8
9
  end
9
10
 
10
11
  def get_shell
11
- if @ssh_shells.any?
12
- @ssh_shells.sample
12
+ if @build_servers.any?
13
+ shell = connect_to_ssh_shell(@build_servers.sample)
14
+ @ssh_shells << shell
15
+ shell
13
16
  else
14
17
  @local_shell
15
18
  end
@@ -20,11 +23,9 @@ class KuberKit::ImageCompiler::BuildServerPool
20
23
  end
21
24
 
22
25
  private
23
- def connect_to_ssh_shells(build_servers)
24
- build_servers.map do |bs|
25
- shell = @ssh_shell_class.new
26
- shell.connect(host: bs.host, user: bs.user, port: bs.port)
27
- shell
28
- end
26
+ def connect_to_ssh_shell(bs)
27
+ shell = @ssh_shell_class.new
28
+ shell.connect(host: bs.host, user: bs.user, port: bs.port)
29
+ shell
29
30
  end
30
31
  end
@@ -41,7 +41,7 @@ class KuberKit::Shell::Commands::KubectlCommands
41
41
  kubectl_run(shell, command_parts, kubeconfig_path: kubeconfig_path, interactive: interactive, namespace: namespace)
42
42
  end
43
43
 
44
- def rolling_restart(shell, deployment_name, kubeconfig_path: nil, namespace: namespace)
44
+ def rolling_restart(shell, deployment_name, kubeconfig_path: nil, namespace: nil)
45
45
  patch_deployment(shell, deployment_name, {
46
46
  spec: {
47
47
  template: {
@@ -56,5 +56,7 @@ class KuberKit::Shell::SshSession
56
56
  end
57
57
 
58
58
  stdout_data
59
+ rescue Net::SSH::Exception => e
60
+ raise SshSessionError, "Shell command failed: #{command}\r\n#{e.message}"
59
61
  end
60
62
  end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-27 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts-lite