kbe 0.2.3 → 0.2.4
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/attach_command.rb +29 -0
- data/lib/kbe/cli/root_command.rb +3 -0
- data/lib/kbe/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b925c72cdef790ba3b78e5bd6734630179409557b9f7d9936956ba6ba93f8b14
|
4
|
+
data.tar.gz: 8005c7c5ed8b3735859715360cd43bf02364fd485024df18190e89c0a71da810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe5679de6636b8ef51981fd988706415d31bfab92e7f0b7ebc8b185270281e57b8f116cf34258408fc46044a8c30e3e3ae068c7272972af2c36be85dc0516e98
|
7
|
+
data.tar.gz: 59e4b10d7e1b31457971e47e1b4a19113e6804fa740c0d7b2f32813595488080f305199ab686d5077623966c02aa81ee7068f15fa71bb924d70dea6f589952c3
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module KBE
|
4
|
+
module CLI
|
5
|
+
class AttachCommand < Clamp::Command
|
6
|
+
option ['-h', '--help'], :flag, "help" do
|
7
|
+
puts "kbe attach myapp"
|
8
|
+
exit 0
|
9
|
+
end
|
10
|
+
|
11
|
+
option ['-c', '--container'], 'CONTAINER', 'container', default: :first
|
12
|
+
|
13
|
+
parameter "SELECTOR_OR_POD", "selector or pod name"
|
14
|
+
|
15
|
+
def execute
|
16
|
+
pod = KBE.pod_by selector_or_pod
|
17
|
+
|
18
|
+
args = []
|
19
|
+
args << "attach -it #{pod}"
|
20
|
+
unless container == :first
|
21
|
+
args << "-c #{container}"
|
22
|
+
end
|
23
|
+
|
24
|
+
KBE.kubectl args
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
data/lib/kbe/cli/root_command.rb
CHANGED
@@ -5,6 +5,7 @@ require_relative "enter_command"
|
|
5
5
|
require_relative "list_command"
|
6
6
|
require_relative "delete_command"
|
7
7
|
require_relative "logs_command"
|
8
|
+
require_relative "attach_command"
|
8
9
|
|
9
10
|
module KBE
|
10
11
|
module CLI
|
@@ -17,6 +18,8 @@ module KBE
|
|
17
18
|
end
|
18
19
|
subcommand ["list"], "List pods", ListCommand
|
19
20
|
subcommand ["enter"], "Enter a container", EnterCommand
|
21
|
+
subcommand ["attach"], "Attach to a container", AttachCommand
|
22
|
+
|
20
23
|
subcommand ["logs"], "Get logs", LogsCommand
|
21
24
|
subcommand ["delete"], "Delete a pod", DeleteCommand
|
22
25
|
|
data/lib/kbe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kbe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- kbe.gemspec
|
111
111
|
- lib/kbe.rb
|
112
112
|
- lib/kbe/cli.rb
|
113
|
+
- lib/kbe/cli/attach_command.rb
|
113
114
|
- lib/kbe/cli/delete_command.rb
|
114
115
|
- lib/kbe/cli/enter_command.rb
|
115
116
|
- lib/kbe/cli/help_command.rb
|