kontena-cli 0.16.0.rc1 → 0.16.0.rc2

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
  SHA1:
3
- metadata.gz: 074582c5f337898b55470514cd0241dda4fd7186
4
- data.tar.gz: f12755e0088565b92c5c0a670926cf5316392a28
3
+ metadata.gz: 051696774831893f38af45c6790e320cf2a7da4e
4
+ data.tar.gz: 46e7cb09fdcb4b1c02706948d7f70591542904a5
5
5
  SHA512:
6
- metadata.gz: 5c53cc63797bea13a5a3b5b500e66b673763ca9af9eb4f78cb348a8a9a8990be9a048494b8aa3ce0384c54ef59f2e50d1fd8a8768b16bca84d11bd6790e8b832
7
- data.tar.gz: 88e71e8730ec8d03001d3afc8d978cd917e28a5cbc00c782637e70a16fe4a4a275656fa4c50e0b325bcf29776a36d5d215746e12146bb2b0cebe377b622703ac
6
+ metadata.gz: 87e2d9d32a07d852588178cf9044469c2651b88dc68e7611eeeb333e409b97717c0aa4cda9e80ba2bd36a64864dfc8518a346c57e3410894f7efd4d0ce94590b
7
+ data.tar.gz: 9e6974e85c570f104b444a0c6730d9bc471fdd41495b9d8254f1f769fa8a9057779c9c9b5289837ac6cad51dbcf07f7086f1966448dcb0d087eec2064795fdfe
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.0.rc1
1
+ 0.16.0.rc2
@@ -20,7 +20,7 @@ module Kontena
20
20
  return unless command.result.has_key?(:name)
21
21
  return unless config.current_master
22
22
  return unless config.current_master.name == command.result[:name]
23
- if command.respond_to?(:skip_auth_provider) && command.skip_auth_provider?
23
+ if command.respond_to?(:skip_auth_provider?) && command.skip_auth_provider?
24
24
  return
25
25
  end
26
26
 
@@ -2,6 +2,7 @@ require 'open3'
2
2
 
3
3
  module Kontena::Cli::Plugins
4
4
  class UninstallCommand < Kontena::Command
5
+ include Kontena::Util
5
6
  include Kontena::Cli::Common
6
7
 
7
8
  parameter 'NAME', 'Plugin name'
@@ -14,11 +15,11 @@ module Kontena::Cli::Plugins
14
15
 
15
16
  def uninstall_plugin(name)
16
17
  plugin = "kontena-plugin-#{name}"
17
- gem_bin = `which gem`.strip
18
- install_command = "#{gem_bin} install -q #{plugin}"
18
+ gem_bin = which('gem')
19
+ uninstall_command = "#{gem_bin} uninstall -q #{plugin}"
19
20
  success = false
20
21
  spinner "Uninstalling plugin #{name.colorize(:cyan)}" do
21
- stdout, stderr, status = Open3.capture3(install_command)
22
+ stdout, stderr, status = Open3.capture3(uninstall_command)
22
23
  unless stderr.empty?
23
24
  raise stderr
24
25
  end
@@ -38,6 +38,11 @@ module Kontena
38
38
  CHARS_LENGTH = CHARS.length
39
39
 
40
40
  def self.spin_no_tty(msg, &block)
41
+ unless block_given?
42
+ Kernel.puts "\r [" + "done".colorize(:green) + "] #{msg}"
43
+ return
44
+ end
45
+
41
46
  Kernel.puts "* #{msg}.. "
42
47
  result = nil
43
48
  status = nil
@@ -68,6 +73,11 @@ module Kontena
68
73
  def self.spin(msg, &block)
69
74
  return spin_no_tty(msg, &block) unless $stdout.tty?
70
75
 
76
+ unless block_given?
77
+ Kernel.puts "\r [" + "done".colorize(:green) + "] #{msg}"
78
+ return
79
+ end
80
+
71
81
  Thread.main['spinners'] ||= []
72
82
  unless Thread.main['spinners'].empty?
73
83
  Thread.main['spinners'].each do |thread|
@@ -1,6 +1,7 @@
1
1
  module Kontena::Cli::Vpn
2
2
  class RemoveCommand < Kontena::Command
3
3
  include Kontena::Cli::Common
4
+ include Kontena::Cli::GridOptions
4
5
 
5
6
  option "--force", :flag, "Force remove", default: false, attribute_name: :forced
6
7
 
@@ -12,7 +13,7 @@ module Kontena::Cli::Vpn
12
13
  vpn = client(token).get("services/#{current_grid}/#{name}") rescue nil
13
14
  exit_with_error("#{name} service does not exist") if vpn.nil?
14
15
 
15
- spinner "Removing #{vpn.colorize(:cyan)} service " do
16
+ spinner "Removing #{name.colorize(:cyan)} service " do
16
17
  client(token).delete("services/#{current_grid}/vpn")
17
18
  end
18
19
  end
@@ -1,7 +1,6 @@
1
1
  require_relative 'vpn/create_command'
2
2
  require_relative 'vpn/config_command'
3
3
  require_relative 'vpn/remove_command'
4
- require_relative 'vpn/delete_command'
5
4
 
6
5
  class Kontena::Cli::VpnCommand < Kontena::Command
7
6
 
@@ -57,7 +57,7 @@ module Kontena
57
57
  api_url,
58
58
  omit_default_port: true,
59
59
  connect_timeout: ENV["EXCON_CONNECT_TIMEOUT"] || 5,
60
- read_timeout: ENV["EXCON_READ_TIMEOUT"] || 5,
60
+ read_timeout: ENV["EXCON_READ_TIMEOUT"] || 30,
61
61
  write_timeout: ENV["EXCON_WRITE_TIMEOUT"] || 5
62
62
  )
63
63
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.rc1
4
+ version: 0.16.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -364,7 +364,6 @@ files:
364
364
  - lib/kontena/cli/version_command.rb
365
365
  - lib/kontena/cli/vpn/config_command.rb
366
366
  - lib/kontena/cli/vpn/create_command.rb
367
- - lib/kontena/cli/vpn/delete_command.rb
368
367
  - lib/kontena/cli/vpn/remove_command.rb
369
368
  - lib/kontena/cli/vpn_command.rb
370
369
  - lib/kontena/cli/whoami_command.rb
@@ -1,17 +0,0 @@
1
- module Kontena::Cli::Vpn
2
- class DeleteCommand < Kontena::Command
3
- include Kontena::Cli::Common
4
- include Kontena::Cli::GridOptions
5
-
6
- def execute
7
- warning "Support for 'kontena vpn delete' will be dropped. Use 'kontena vpn remove' instead."
8
- require_api_url
9
- token = require_token
10
-
11
- vpn = client(token).get("services/#{current_grid}/vpn") rescue nil
12
- abort("VPN service does not exist") if vpn.nil?
13
-
14
- client(token).delete("services/#{current_grid}/vpn")
15
- end
16
- end
17
- end