docker_rails_proxy 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91321365d584c3ac944ae3563520981b330dffe9b4e9ab12aa77311f19e28bec
4
- data.tar.gz: c1750aba15fb09361886d51e1fab611e488d61adebec6693f52c2e0966714c9d
3
+ metadata.gz: b9b3b25d46ab93efcfe8301c759bc45e0908183af40a8fa90c3f12fe7c5f889f
4
+ data.tar.gz: 1519b485518a1cf17b2f4dfe2fcc41ed243cca5ab2a1f4135a80a2514cf4862a
5
5
  SHA512:
6
- metadata.gz: dbf4400a91a0cc56ae59e1188e64dc4bb9bc1a40fee5fb74285943409f4781d924cc46ba1c668568ba43acfee0a88a3fa40c8e057cdba01a4fedbece552c1ede
7
- data.tar.gz: e426c0c20ebdb3a9bcd5078d403304ed71b409caac7de68919957cbf685f6d7cc17626709a2b7c159ca54a338ce07f363e2c196254306e36526708a570fbaa31
6
+ metadata.gz: ca599ca5b7afe6e5862e11e80244ca42900772eb7376b6bb600fc9f6018b3ce270076b9ef6209c05a8a5fba3f6647adfa9cfa3a4e7cddc5050d5d642eba47528
7
+ data.tar.gz: c306ef28db56be3fdd223b62b67affebe4a54e6be809ef6c8b4084c9a4689485edddccd2e16fd65eda32fadd2075fdef8704673057fcf68faad80750d12f34fd
@@ -7,7 +7,7 @@ module DockerRailsProxy
7
7
  attr_accessor :data
8
8
 
9
9
  before_process do
10
- self.data = JSON.parse kubectl_output("get #{pod} -o json")
10
+ self.data = JSON.parse kubectl_output("get pod #{pod} -o json")
11
11
  end
12
12
 
13
13
  def process
@@ -15,7 +15,6 @@ module DockerRailsProxy
15
15
  container.delete attr
16
16
  end
17
17
 
18
-
19
18
  overrides = {
20
19
  metadata: {
21
20
  annotations: {
@@ -45,7 +44,7 @@ module DockerRailsProxy
45
44
  }
46
45
  }
47
46
 
48
- pod_name = "#{container['name']}-bash-#{Time.now.to_i}"
47
+ pod_name = "#{container['name']}-bash-#{Time.now.strftime '%Y%m%d%H%M%S'}"
49
48
  puts "Starting #{pod_name} pod ..."
50
49
 
51
50
  kubectl <<-EOS
@@ -60,7 +59,15 @@ module DockerRailsProxy
60
59
 
61
60
  def pod
62
61
  @pod_name ||= begin
63
- pods = kubectl_output('get pods -o name').split(' ')
62
+ pods = kubectl_output(<<-EOS).split(" ")
63
+ get pods -o jsonpath='{range .items[*]}{.metadata.name},{.status.phase}{" "}{end}'}
64
+ EOS
65
+
66
+ pods = pods.map do |values|
67
+ name, phase = values.split(',')
68
+ phase == 'Running' ? name : nil
69
+ end.compact
70
+
64
71
  until_get_option pods, "Choose a pod and press [ENTER]"
65
72
  end
66
73
  end
@@ -1,3 +1,3 @@
1
1
  module DockerRailsProxy
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_rails_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jairo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-27 00:00:00.000000000 Z
12
+ date: 2018-04-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Configures docker-compose and provides rails command helpers
15
15
  email: