kbe 0.2.3 → 0.2.4

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: be5e471aaa83ef9dd04ec665eea8d5ab9751fab64b2e653ce0ccbc5f2939bbb1
4
- data.tar.gz: d3ae8dc88f2119f3e520341f04088dec6727e61cf5807290f6d61d396bd7a7df
3
+ metadata.gz: b925c72cdef790ba3b78e5bd6734630179409557b9f7d9936956ba6ba93f8b14
4
+ data.tar.gz: 8005c7c5ed8b3735859715360cd43bf02364fd485024df18190e89c0a71da810
5
5
  SHA512:
6
- metadata.gz: 7a9df45ef19e8801c0528179620c19979c406889b245503f277b832003720153906df86bc0267a673d26cba79c5470c544f28cf0b7ef09407413fb067313a8d4
7
- data.tar.gz: 653988353149dce476293838db0ee7914f005328c49c42977cfadc1aaebc8630d5c3c3151dd78e464cb756ae3a0d18fb47d5d7ec043fcbf60d57d3183319dda9
6
+ metadata.gz: fe5679de6636b8ef51981fd988706415d31bfab92e7f0b7ebc8b185270281e57b8f116cf34258408fc46044a8c30e3e3ae068c7272972af2c36be85dc0516e98
7
+ data.tar.gz: 59e4b10d7e1b31457971e47e1b4a19113e6804fa740c0d7b2f32813595488080f305199ab686d5077623966c02aa81ee7068f15fa71bb924d70dea6f589952c3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kbe (0.2.3)
4
+ kbe (0.2.4)
5
5
  clamp
6
6
  colorize (~> 0.8, >= 0.8.1)
7
7
 
@@ -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
+
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module KBE
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
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.3
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-07 00:00:00.000000000 Z
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