kplay 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kplay/config.rb +2 -1
- data/lib/kplay/minikube.rb +0 -16
- data/lib/kplay/pod.rb +11 -8
- data/lib/kplay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cf0f80f50de689e33da4d0f9fb8b51295e3d50f4
|
|
4
|
+
data.tar.gz: b61eb551a31a32c24b9db57b3646b9d3ab27304f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c1afd53acf9dd1982747dc28524e650234eb3652c4b33e5125ff65186da0dff6f6dd56ee999069430785c069e55d7d6c137932850cf989bf48d27aadf2724b5
|
|
7
|
+
data.tar.gz: 659e234dca21a60fac32b895d4ebc112d018302966a2932737ea951951f7407440dfcc34e79576e7e96f63beb9ef5cb7759e65aa6b15a03a02423e2308eac5bf
|
data/lib/kplay/config.rb
CHANGED
|
@@ -13,7 +13,8 @@ module Kplay
|
|
|
13
13
|
'shell' => '/bin/bash',
|
|
14
14
|
'shell_args' => ['-c', 'cd /${name}; exec "${SHELL:-sh}"'],
|
|
15
15
|
'stop_grace_period' => 5,
|
|
16
|
-
'etc_hosts' => [] # <ip> <alias1> [<alias2> ...]
|
|
16
|
+
'etc_hosts' => [], # <ip> <alias1> [<alias2> ...],
|
|
17
|
+
'volumes' => [] # ["<from>:<to>", ...]
|
|
17
18
|
}.freeze
|
|
18
19
|
|
|
19
20
|
attr_reader :path, :data
|
data/lib/kplay/minikube.rb
CHANGED
|
@@ -43,21 +43,5 @@ module Kplay
|
|
|
43
43
|
end
|
|
44
44
|
Pathname.new(path_host.to_s.sub(hostfolder_host.to_s, hostfolder_vm.to_s))
|
|
45
45
|
end
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
# Returns true if SSH agent forwarding can be enabled
|
|
49
|
-
# (socket resides in VM mounted folders)
|
|
50
|
-
#
|
|
51
|
-
def self.ssh_forwarding_available?
|
|
52
|
-
!!ssh_forwarding_socket_vm
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# Returns path to SSH agent forwarding socket in a VM
|
|
56
|
-
#
|
|
57
|
-
def self.ssh_forwarding_socket_vm
|
|
58
|
-
socket_path = ENV['SSH_AUTH_SOCK']
|
|
59
|
-
return nil unless socket_path
|
|
60
|
-
Minikube.host_path_in_vm(socket_path) rescue nil
|
|
61
|
-
end
|
|
62
46
|
end # module Minikube
|
|
63
47
|
end # module Kplay
|
data/lib/kplay/pod.rb
CHANGED
|
@@ -67,14 +67,17 @@ module Kplay
|
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
# add custom volumes
|
|
71
|
+
config[:volumes].each_with_index do |volume_def, i|
|
|
72
|
+
v_from, v_to = volume_def.split(':')
|
|
73
|
+
v_from = Kplay::Minikube.host_path_in_vm(Pathname.new(v_from).expand_path)
|
|
74
|
+
v_to = Pathname.new(v_to) # do not expand path locally
|
|
75
|
+
name = 'volume-' + i.to_s
|
|
76
|
+
c['spec']['containers'].first['volumeMounts'] <<
|
|
77
|
+
{ 'name' => name, 'mountPath' => v_to.to_s }
|
|
78
|
+
c['spec']['volumes'] <<
|
|
79
|
+
{ 'name' => name, 'hostPath' => { 'path' => v_from.to_s } }
|
|
80
|
+
end
|
|
78
81
|
c
|
|
79
82
|
end
|
|
80
83
|
|
data/lib/kplay/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kplay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Kukushkin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-05-
|
|
11
|
+
date: 2018-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|