kontena-cli 0.16.0.rc2 → 0.16.0.rc3

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: 051696774831893f38af45c6790e320cf2a7da4e
4
- data.tar.gz: 46e7cb09fdcb4b1c02706948d7f70591542904a5
3
+ metadata.gz: 639ee46ae3a2e35cd233618b89c463e8b66afec6
4
+ data.tar.gz: d1fa540a0a6f95deae41f8f89da60d07b62138dd
5
5
  SHA512:
6
- metadata.gz: 87e2d9d32a07d852588178cf9044469c2651b88dc68e7611eeeb333e409b97717c0aa4cda9e80ba2bd36a64864dfc8518a346c57e3410894f7efd4d0ce94590b
7
- data.tar.gz: 9e6974e85c570f104b444a0c6730d9bc471fdd41495b9d8254f1f769fa8a9057779c9c9b5289837ac6cad51dbcf07f7086f1966448dcb0d087eec2064795fdfe
6
+ metadata.gz: 6c181a8df5253b768c91afd964327bf9a5b940156bd453fdb0f5fc2e804e22470ad51ebe0cdaab1f0de6f491c76bb19fb7c7d48542b2a9ea58e840a8a1e3ee09
7
+ data.tar.gz: d096bbb4557f247a3e6345e32a6fb95dafb1e79b091bc2c702961975dfd78c75183a335ddd441267e1e6168ceda11ea47f47ad59fdee394e917ff0ddf6de1aa2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.0.rc2
1
+ 0.16.0.rc3
@@ -40,9 +40,13 @@ module Kontena
40
40
  puts "You don't seem to be logged in to Kontena Cloud"
41
41
  puts
42
42
  Kontena.run("cloud login --verbose")
43
+ config.reset_instance
44
+ reset_cloud_client
45
+ result = false
43
46
  Retriable.retriable do
44
- cloud_client.authentication_ok?(kontena_account.userinfo_endpoint)
47
+ result = cloud_client.authentication_ok?(kontena_account.userinfo_endpoint)
45
48
  end
49
+ result
46
50
  end
47
51
 
48
52
  def before
@@ -120,6 +120,8 @@ module Kontena::Cli::Cloud
120
120
  config.write
121
121
  display_logo
122
122
  display_login_info(only: :account)
123
+ config.reset_instance
124
+ reset_cloud_client
123
125
  exit 0
124
126
  else
125
127
  puts "Authentication failed".colorize(:red)
@@ -112,6 +112,8 @@ module Kontena::Cli::Cloud::Master
112
112
  def execute
113
113
  unless cloud_client.authentication_ok?(kontena_account.userinfo_endpoint)
114
114
  Kontena.run('cloud login')
115
+ config.reset_instance
116
+ reset_cloud_client
115
117
  end
116
118
 
117
119
  return register_current if self.current?
@@ -166,6 +166,10 @@ module Kontena
166
166
  @cloud_client ||= Kontena::Client.new(kontena_account.url, kontena_account.token, prefix: '/')
167
167
  end
168
168
 
169
+ def reset_cloud_client
170
+ @cloud_client = nil
171
+ end
172
+
169
173
  def client(token = nil, api_url = nil)
170
174
  if token.kind_of?(String)
171
175
  token = Kontena::Cli::Config::Token.new(access_token: token)
@@ -511,6 +511,7 @@ module Kontena
511
511
 
512
512
  def account
513
513
  return @account if @account
514
+ return config.find_account('master') unless parent
514
515
  @account =
515
516
  case parent_type
516
517
  when :master then config.find_account(parent.account)
@@ -108,7 +108,7 @@ module Kontena::Cli::Master
108
108
  if self.token
109
109
  # Use supplied token
110
110
  server.token = Kontena::Cli::Config::Token.new(access_token: self.token, parent_type: :master, parent_name: server.name)
111
- elsif server.token.nil?
111
+ elsif server.token.nil? || self.force?
112
112
  # Create new empty token if the server does not have one yet
113
113
  server.token = Kontena::Cli::Config::Token.new(parent_type: :master, parent_name: server.name)
114
114
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0.rc2
4
+ version: 0.16.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc