k-tools 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 647da61a9914126279a25569f3f3104426a6d6decba82940e951aaa0b7203318
4
- data.tar.gz: a3f8b76c95cbe55c3e83d762ea0476c68c1d62e04705f2bb404b12eeba09da05
3
+ metadata.gz: 30ec48398920123370bb0611482ccb89c40fa7fddad76f0c7043f76ba442a964
4
+ data.tar.gz: 84add72490b7164ac6b99fd954d5138f437c42f4ad32d0ad1a8ecbd5202d70a5
5
5
  SHA512:
6
- metadata.gz: 06b4101fe62a7342d8e71efcfa6b2a5ac5878c6edba511976ec4d53048f2469fbb9c93db6de3e761d6938026d32ecb73570e59485a95c18b7a1696e9f4e3a212
7
- data.tar.gz: a819db787b2e6452319ea53cdff91aa868578d84d42d2cefa509b8e21e9a6532b239bb01d90b76c1ad8483d48b3d69ecad510370ddf57d0b054f838632c1804f
6
+ metadata.gz: b5f9d08ead6d54f61c168ac55d155cf9dc4cd977b5d0eb3799fd07138ed3b71460cdadf9bd93ef73e93fc0ca0984d593d9c2df2562b9df812f727e8a53cfd32d
7
+ data.tar.gz: 94b7cd4120b353871a700b7ab0209c6e36d5b8deee5d929d7179550f55ecc904585ba237613349043ffea4ee07688b7c24503ed20e650d2fff9c138e3bb2609f
@@ -57,7 +57,7 @@ module KTools
57
57
  puts ""
58
58
 
59
59
  pod = get_pod
60
- container = "#{@subject}-container"
60
+ container = get_container(pod)
61
61
 
62
62
  if @argument == "--tail"
63
63
  Sh.ell_in!("kubectl logs -f #{pod} #{@opt} -n foxbox -c #{container}")
@@ -80,6 +80,11 @@ module KTools
80
80
  pods = Sh.elld!("kubectl get pods -n foxbox | grep #{@subject}")
81
81
  pods[/(^\S*)/]
82
82
  end
83
+
84
+ def get_container(pod)
85
+ containers = Sh.elld!("kubectl get pods #{pod} -n foxbox -o jsonpath='{.spec.containers[*].name}'")
86
+ containers[/(^\S*)/]
87
+ end
83
88
  end
84
89
  end
85
90
  end
@@ -1,3 +1,3 @@
1
1
  module KTools
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Schuindt