kplay 0.3.2 → 0.4.0

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
  SHA1:
3
- metadata.gz: ee454eb8cc66ab390cf4a69147164d3eb6467d34
4
- data.tar.gz: 6e6feaf91aa9ede0800d6ca476a94ffac3017a3f
3
+ metadata.gz: cf0f80f50de689e33da4d0f9fb8b51295e3d50f4
4
+ data.tar.gz: b61eb551a31a32c24b9db57b3646b9d3ab27304f
5
5
  SHA512:
6
- metadata.gz: ea6dffb4f2faab9de1c863becd39cd07f4f93b06835f225971b2665159eb6ee1d55a4c60546b8c3e93254fae9891afeff3a16889869aa9af89b30b39926fba2f
7
- data.tar.gz: ec157892f3a2c18767506071e92ef0e6b556b763d439eff8daf729414573f6f953ee48f52aa6122b79a8ea4c9b7a467e854a8667ccadfc1adc1a3ddf681927af
6
+ metadata.gz: 1c1afd53acf9dd1982747dc28524e650234eb3652c4b33e5125ff65186da0dff6f6dd56ee999069430785c069e55d7d6c137932850cf989bf48d27aadf2724b5
7
+ data.tar.gz: 659e234dca21a60fac32b895d4ebc112d018302966a2932737ea951951f7407440dfcc34e79576e7e96f63beb9ef5cb7759e65aa6b15a03a02423e2308eac5bf
@@ -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
@@ -67,14 +67,17 @@ module Kplay
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.to_s }
74
- c['spec']['containers'].first['volumeMounts'] <<
75
- { 'name' => 'ssh-auth-sock', 'mountPath' => Kplay::Minikube.ssh_forwarding_socket_vm.to_s }
76
- c['spec']['volumes'] <<
77
- { 'name' => 'ssh-auth-sock', 'hostPath' => { 'path' => Kplay::Minikube.ssh_forwarding_socket_vm.to_s } }
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
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kplay
3
- VERSION = '0.3.2'.freeze
3
+ VERSION = '0.4.0'.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.2
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-05 00:00:00.000000000 Z
11
+ date: 2018-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor