kplay 0.3.0 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/kplay.gemspec +1 -1
- data/lib/kplay/config.rb +2 -1
- data/lib/kplay/minikube.rb +0 -16
- data/lib/kplay/pod.rb +14 -11
- data/lib/kplay/version.rb +1 -1
- metadata +11 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dc35b067b4f0dbb20c4e1a6dee5836e55bdb8ebdad15f904d016612841c3500c
|
4
|
+
data.tar.gz: f836b8eee716c322689020b7d1082f265ce19e7a4b4615efbddb9beba7c6fb8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cfcb34d4e73b017549ce8edcb3302b89be99aeeda981c30d315ace03fd269dbb93cad13de5d55ce5c6353c31100a57074e7b504cb0ec91438f556f06d2817f7
|
7
|
+
data.tar.gz: 5c231acbd206b8cad4984645389b05b12eae73afa196e6807713b382aea59b9094bb1e6d22d69be85ab79a84cde45bc51c2a98caa816115fd0beba2b1f168efa
|
data/kplay.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency 'rainbow', '~> 3.0'
|
35
35
|
|
36
36
|
spec.add_development_dependency 'bundler', '~> 1.14'
|
37
|
-
spec.add_development_dependency 'rake', '~>
|
37
|
+
spec.add_development_dependency 'rake', '~> 12.0', '>= 12.3.3'
|
38
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
39
|
spec.add_development_dependency 'pry', '~> 0.11'
|
40
40
|
end
|
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
@@ -61,20 +61,23 @@ module Kplay
|
|
61
61
|
'volumes' => [
|
62
62
|
{
|
63
63
|
'name' => volume_name,
|
64
|
-
'hostPath' => { 'path' =>
|
64
|
+
'hostPath' => { 'path' => path_vm.to_s }
|
65
65
|
}
|
66
66
|
# <-- ssh forwarding socket in VM mounted here
|
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
|
|
@@ -97,7 +100,7 @@ module Kplay
|
|
97
100
|
#
|
98
101
|
def stop!
|
99
102
|
Kplay.sh(
|
100
|
-
['kubectl', 'delete', 'pod', name, "--grace-period=#{config[:stop_grace_period]}"
|
103
|
+
['kubectl', 'delete', 'pod', name, "--grace-period=#{config[:stop_grace_period]}"],
|
101
104
|
echo: options[:verbose]
|
102
105
|
)
|
103
106
|
end
|
@@ -106,7 +109,7 @@ module Kplay
|
|
106
109
|
#
|
107
110
|
def shell
|
108
111
|
Kplay.sh(
|
109
|
-
['kubectl', 'exec', name, '
|
112
|
+
['kubectl', 'exec', '-ti', name, '--', config[:shell], *config[:shell_args]],
|
110
113
|
tty: true,
|
111
114
|
echo: options[:verbose]
|
112
115
|
)
|
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.3
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Kukushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -58,14 +58,20 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '12.0'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 12.3.3
|
62
65
|
type: :development
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
69
|
- - "~>"
|
67
70
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
71
|
+
version: '12.0'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 12.3.3
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
76
|
name: rspec
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
150
|
- !ruby/object:Gem::Version
|
145
151
|
version: '0'
|
146
152
|
requirements: []
|
147
|
-
|
148
|
-
rubygems_version: 2.5.2
|
153
|
+
rubygems_version: 3.0.3
|
149
154
|
signing_key:
|
150
155
|
specification_version: 4
|
151
156
|
summary: Starts your project within a container in minikube
|