kbe 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/kbe/cli/list_command.rb +12 -1
- data/lib/kbe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b41c564b2cef9fbb854e0b6eb939e09a3b0b1f5338bab512edc6277b43e63a4a
|
4
|
+
data.tar.gz: 51c0936286402e79052652894ef66063c4566fc9fcc567523e6c3f1d9c313a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b71725f1da13f026212f06d70be2d3944c637035ea16dd5f2ed3b39c923bd536e3e3545920ae96b2ab07b8b241721553cba9f5e0ba0d94e229f823b6a5ac8c7
|
7
|
+
data.tar.gz: 21fc9cf08ce12599a5fb748c88013b193bf0a6a2fbb9c2fa70ab5b6e53bcba2918938cb029fc2bf7924d265906dc50e1239dd87d31c97f170cd4ac6215c664d3
|
data/Gemfile.lock
CHANGED
data/lib/kbe/cli/list_command.rb
CHANGED
@@ -1,15 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require "json"
|
2
3
|
|
3
4
|
module KBE
|
4
5
|
module CLI
|
5
6
|
class ListCommand < Clamp::Command
|
6
7
|
option ['-h', '--help'], :flag, "help" do
|
7
8
|
puts "kbe list"
|
9
|
+
puts "kbe list pod"
|
8
10
|
exit 0
|
9
11
|
end
|
10
12
|
|
13
|
+
parameter "[POD]", "pod"
|
14
|
+
|
11
15
|
def execute
|
12
|
-
|
16
|
+
if pod
|
17
|
+
json = JSON.parse(`kubectl get pod #{pod} -o json`)
|
18
|
+
for container in json["spec"]["containers"]
|
19
|
+
puts container["name"]
|
20
|
+
end
|
21
|
+
else
|
22
|
+
KBE.kubectl ["get pod"]
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
data/lib/kbe/version.rb
CHANGED