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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e33ce504a8556db68e6a1d1527a6c0acae9d76b8
4
- data.tar.gz: ed304d74a3784d09568fd8f171db18cc1be3cd25
2
+ SHA256:
3
+ metadata.gz: dc35b067b4f0dbb20c4e1a6dee5836e55bdb8ebdad15f904d016612841c3500c
4
+ data.tar.gz: f836b8eee716c322689020b7d1082f265ce19e7a4b4615efbddb9beba7c6fb8d
5
5
  SHA512:
6
- metadata.gz: 7025d7487f8cbe6fb77f5f573581c11383599538a531b23a26a9bfc24dd2b63a5386b3e85664c9bc628eab5f199635b24527c7bec7e7129d3ad91acf8ab1f7c7
7
- data.tar.gz: acef8a5a62e71fb839bcb1d283b9dd13cbad99b6ef957dab9a0812b6fe9dbac82655a33de1040a609627782fd67beb911783217b113646542500229d4da83cf7
6
+ metadata.gz: 5cfcb34d4e73b017549ce8edcb3302b89be99aeeda981c30d315ace03fd269dbb93cad13de5d55ce5c6353c31100a57074e7b504cb0ec91438f556f06d2817f7
7
+ data.tar.gz: 5c231acbd206b8cad4984645389b05b12eae73afa196e6807713b382aea59b9094bb1e6d22d69be85ab79a84cde45bc51c2a98caa816115fd0beba2b1f168efa
@@ -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', '~> 10.0'
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
@@ -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
@@ -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
@@ -61,20 +61,23 @@ module Kplay
61
61
  'volumes' => [
62
62
  {
63
63
  'name' => volume_name,
64
- 'hostPath' => { 'path' => path_host }
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
- return c unless Kplay::Minikube.ssh_forwarding_available?
71
- # enable SSH forwarding
72
- c['spec']['containers'].first['env'] <<
73
- { 'name' => 'SSH_AUTH_SOCK', 'value' => Kplay::Minikube.ssh_forwarding_socket_vm }
74
- c['spec']['containers'].first['volumeMounts'] <<
75
- { 'name' => 'ssh_auth_sock', 'mountPath' => Kplay::Minikube.ssh_forwarding_socket_vm }
76
- c['spec']['volumes'] <<
77
- { 'name' => 'ssh_auth_sock', 'hostPath' => { 'path' => Kplay::Minikube.ssh_forwarding_socket_vm } }
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]}", '--force'],
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, '-ti', config[:shell], '--', *config[:shell_args]],
112
+ ['kubectl', 'exec', '-ti', name, '--', config[:shell], *config[:shell_args]],
110
113
  tty: true,
111
114
  echo: options[:verbose]
112
115
  )
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kplay
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.3'.freeze
4
4
  end
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.0
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: 2018-05-05 00:00:00.000000000 Z
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: '10.0'
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: '10.0'
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
- rubyforge_project:
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