hetzner-k3s 0.6.3 → 0.6.4

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: 2bbaf7bd5387cc92f0725308a42f982df7b47596d5d1a3d50693cf3b6a741359
4
- data.tar.gz: 0617b66a6ca8299c5c5ada69c586a532e915657c857c6f6821cd81d29c17a774
3
+ metadata.gz: 17e2373497278dc7f975158e93d2f0041e2e7b248fc31ba90f9088ad5a0c8b35
4
+ data.tar.gz: 35ff6dee9d6a84dbf7d1265ac4646da142c6ea030815dca4dbe6727528dec6de
5
5
  SHA512:
6
- metadata.gz: a457da09e05ac40da2d0b40de65193f16ecd42ae926f6d59271ca9fedc77587faf2bb90b4c4a62e326e509076b0f44e84062fb6c72536e5e8c1ce4b716d56813
7
- data.tar.gz: '0628cf98daa772f50251257b626ca148420d1a8853618652c9fd7dd6750694393d9902ea684c786029e0db3bcf8d01729aa217e9fc3c070067fbbe6afb395dd8'
6
+ metadata.gz: 3a23e73a53b5cb205609c5b6cdaa17ef70bafcbf0c5783c0fa988fccac9cdae8da20fd12c3f644e47d2ff6d66bf914bcb2b0540ff83ef7a79943e970bd36bc18
7
+ data.tar.gz: 565b8e15b98dba8a0fbd0ef4699b0890fb5536e0f80d99f2dcab19352a26b50389c2923c4658a685a60569fa054b777fbe9d0111f9f9b1b78cd24070dceab96c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hetzner-k3s (0.6.2)
4
+ hetzner-k3s (0.6.4)
5
5
  bcrypt_pbkdf
6
6
  childprocess
7
7
  ed25519
data/README.md CHANGED
@@ -64,7 +64,7 @@ brew install vitobotta/tap/hetzner_k3s
64
64
  #### Binary installation (Intel)
65
65
 
66
66
  ```bash
67
- wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.3/hetzner-k3s-mac-amd64
67
+ wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.4/hetzner-k3s-mac-amd64
68
68
  chmod +x hetzner-k3s-mac-x64
69
69
  sudo mv hetzner-k3s-mac-x64 /usr/local/bin/hetzner-k3s
70
70
  ```
@@ -72,7 +72,7 @@ sudo mv hetzner-k3s-mac-x64 /usr/local/bin/hetzner-k3s
72
72
  #### Binary installation (Apple Silicon/M1)
73
73
 
74
74
  ```bash
75
- wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.3/hetzner-k3s-mac-arm64
75
+ wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.4/hetzner-k3s-mac-arm64
76
76
  chmod +x hetzner-k3s-mac-arm
77
77
  sudo mv hetzner-k3s-mac-arm /usr/local/bin/hetzner-k3s
78
78
  ```
@@ -82,7 +82,7 @@ NOTE: currently the ARM version still requires [Rosetta](https://support.apple.c
82
82
  ### Linux
83
83
 
84
84
  ```bash
85
- wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.3/hetzner-k3s-linux-x86_64
85
+ wget https://github.com/vitobotta/hetzner-k3s/releases/download/v0.6.4/hetzner-k3s-linux-x86_64
86
86
  chmod +x hetzner-k3s-linux-x86_64
87
87
  sudo mv hetzner-k3s-linux-x86_64 /usr/local/bin/hetzner-k3s
88
88
  ```
@@ -107,7 +107,7 @@ Alternatively, if you don't want to set up a Ruby runtime but have Docker instal
107
107
  docker run --rm -it \
108
108
  -v ${PWD}:/cluster \
109
109
  -v ${HOME}/.ssh:/tmp/.ssh \
110
- vitobotta/hetzner-k3s:v0.6.3 \
110
+ vitobotta/hetzner-k3s:v0.6.4 \
111
111
  create-cluster \
112
112
  --config-file /cluster/test.yaml
113
113
  ```
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hetzner
4
4
  module K3s
5
- VERSION = '0.6.3'
5
+ VERSION = '0.6.4'
6
6
  end
7
7
  end
data/lib/hetzner/utils.rb CHANGED
@@ -69,6 +69,7 @@ module Utils
69
69
  end
70
70
 
71
71
  def ssh(server, command, print_output: false)
72
+ debug = ENV.fetch('SSH_DEBUG', false)
72
73
  retries = 0
73
74
 
74
75
  public_ip = server.dig('public_net', 'ipv4', 'ip')
@@ -77,6 +78,7 @@ module Utils
77
78
  params = { verify_host_key: (verify_host_key ? :always : :never) }
78
79
 
79
80
  params[:keys] = private_ssh_key_path && [private_ssh_key_path]
81
+ params[:verbose] = :debug if debug
80
82
 
81
83
  Net::SSH.start(public_ip, 'root', params) do |session|
82
84
  session.exec!(command) do |_channel, _stream, data|
@@ -85,19 +87,24 @@ module Utils
85
87
  end
86
88
  end
87
89
  output.chop
88
- rescue Timeout::Error, IOError, Errno::EBADF
90
+ rescue Timeout::Error, IOError, Errno::EBADF => e
91
+ puts "SSH CONNECTION DEBUG: #{e.message}" if debug
89
92
  retries += 1
90
93
  retry unless retries > 15
91
94
  rescue Net::SSH::Disconnect => e
95
+ puts "SSH CONNECTION DEBUG: #{e.message}" if debug
92
96
  retries += 1
93
97
  retry unless retries > 15 || e.message =~ /Too many authentication failures/
94
- rescue Net::SSH::ConnectionTimeout, Errno::ECONNREFUSED, Errno::ENETUNREACH, Errno::EHOSTUNREACH
98
+ rescue Net::SSH::ConnectionTimeout, Errno::ECONNREFUSED, Errno::ENETUNREACH, Errno::EHOSTUNREACH => e
99
+ puts "SSH CONNECTION DEBUG: #{e.message}" if debug
95
100
  retries += 1
96
101
  retry if retries <= 15
97
- rescue Net::SSH::AuthenticationFailed
102
+ rescue Net::SSH::AuthenticationFailed => e
103
+ puts "SSH CONNECTION DEBUG: #{e.message}" if debug
98
104
  puts '\nCannot continue: SSH authentication failed. Please ensure that the private SSH key is correct.'
99
105
  exit 1
100
- rescue Net::SSH::HostKeyMismatch
106
+ rescue Net::SSH::HostKeyMismatch => e
107
+ puts "SSH CONNECTION DEBUG: #{e.message}" if debug
101
108
  puts <<-MESSAGE
102
109
  Cannot continue: Unable to SSH into server with IP #{public_ip} because the existing fingerprint in the known_hosts file does not match that of the actual host key.\n
103
110
  This is due to a security check but can also happen when creating a new server that gets assigned the same IP address as another server you've owned in the past.\n
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hetzner-k3s
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vito Botta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-30 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt_pbkdf