kuby-digitalocean 0.4.2 → 0.4.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 +3 -0
- data/lib/kuby/digitalocean/config.rb +7 -0
- data/lib/kuby/digitalocean/provider.rb +12 -6
- data/lib/kuby/digitalocean/version.rb +1 -1
- 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: e634fdfb6ddb23305dc7f7fa7305a930316e6cbde11a8d8a20410978ed9b6767
|
4
|
+
data.tar.gz: ec0047d9b187c1f1ed31c6ea888ca3d5a0dc5999f6f12d24c25b2a0c7fa4c2e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dbc54986ddc3293495f49b1b1386af7a04b7f684f6ec9eb344ef957fef1c947a43e129a8c3515fc803554a86c25213bac2b1ce937075a1d025a5803e8e19fe6
|
7
|
+
data.tar.gz: 0f1cae30703cfe7adb1bdeea1404f63e08c6cfb00cc418324fb81f4772e50b0f49d8a5f6c1897c4238f35756bb8a83d8345239d365fac48bfb99d415a4286f43
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'kube-dsl'
|
2
|
+
require 'digest'
|
2
3
|
|
3
4
|
module Kuby
|
4
5
|
module DigitalOcean
|
@@ -6,6 +7,12 @@ module Kuby
|
|
6
7
|
extend ::KubeDSL::ValueFields
|
7
8
|
|
8
9
|
value_fields :access_token, :cluster_id
|
10
|
+
|
11
|
+
def hash_value
|
12
|
+
Digest::SHA256.hexdigest(
|
13
|
+
[access_token, cluster_id].join(':')
|
14
|
+
)
|
15
|
+
end
|
9
16
|
end
|
10
17
|
end
|
11
18
|
end
|
@@ -2,6 +2,7 @@ require 'kuby'
|
|
2
2
|
require 'droplet_kit'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'tmpdir'
|
5
|
+
require 'digest'
|
5
6
|
|
6
7
|
module Kuby
|
7
8
|
module DigitalOcean
|
@@ -16,8 +17,9 @@ module Kuby
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def kubeconfig_path
|
19
|
-
|
20
|
-
kubeconfig_dir,
|
20
|
+
File.join(
|
21
|
+
kubeconfig_dir,
|
22
|
+
"#{environment.app_name.downcase}-#{config.hash_value}-kubeconfig.yaml"
|
21
23
|
)
|
22
24
|
end
|
23
25
|
|
@@ -61,14 +63,18 @@ module Kuby
|
|
61
63
|
STORAGE_CLASS_NAME
|
62
64
|
end
|
63
65
|
|
66
|
+
def kubernetes_cli
|
67
|
+
@kubernetes_cli ||= ::KubernetesCLI.new(kubeconfig_path).tap do |cli|
|
68
|
+
cli.before_execute do
|
69
|
+
refresh_kubeconfig
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
64
74
|
private
|
65
75
|
|
66
76
|
def after_initialize
|
67
77
|
@config = Config.new
|
68
|
-
|
69
|
-
kubernetes_cli.before_execute do
|
70
|
-
refresh_kubeconfig
|
71
|
-
end
|
72
78
|
end
|
73
79
|
|
74
80
|
def client
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuby-digitalocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.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: 2020-
|
11
|
+
date: 2020-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: droplet_kit
|