uffizzi-cli 2.4.3 → 2.4.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: 12aba3a7c9cb35a284582d4d15614c2c54bc3e79320ae57484cdc838f5e427f7
4
- data.tar.gz: d55fe3842347380c8c3a26bef9db40a95cd83ecb2a3fa3d7ff31ecc2b9322394
3
+ metadata.gz: c0dca2ba03ac849c8e1ca71bac3c495b698fda210f888320b06bbac114eb2168
4
+ data.tar.gz: 1441cff7ebd668159423966a6b5a9604e8e377a45f8d027802c381814e297d1d
5
5
  SHA512:
6
- metadata.gz: 8750abc88b5ef8deb83d2a60edde1ff06866ec1d4404aae56518b970d3ec78b300ed69fd3f2675b0f2a96fd5c09dd937038c5a45d856a90f49fa8bfdc0400c84
7
- data.tar.gz: 7ca46fbf05024d1e0cfa9eb969502453f8439cc0e7e80f25d711d48a4a3782b13b3331969fb1a626fdbd17eb13d717f17778e35832f3749abbf03e1825167e16
6
+ metadata.gz: 310e1accb7217654da0e8d4f84364c2db240495d5c5d4df602f63a8ad87b72c798b8151817a44a95224599dfd312bd83875fd7a36e4430bb1aefdcbd5425a9f0
7
+ data.tar.gz: 262191965e225983bf075b45a878c49953f4f3955da4628ff64a39b5bc1641182e954a2c6d8bbc4a2808e3f4ba1382edc9b8cacfa36ac0d7de8db3bdf610c41a
@@ -3,6 +3,7 @@
3
3
  require 'uffizzi'
4
4
  require 'uffizzi/config_file'
5
5
  require 'uffizzi/services/kubeconfig_service'
6
+ require 'uffizzi/services/account_service'
6
7
 
7
8
  module Uffizzi
8
9
  class Cli::Install < Thor
@@ -40,7 +41,12 @@ module Uffizzi
40
41
  Uffizzi.ui.say('Helm release is deployed')
41
42
 
42
43
  controller_setting_params = build_controller_setting_params(uri, installation_options)
43
- create_controller_settings(controller_setting_params) if existing_controller_setting.blank?
44
+
45
+ if existing_controller_setting.blank?
46
+ create_controller_settings(controller_setting_params)
47
+ set_account_installation
48
+ end
49
+
44
50
  Uffizzi.ui.say('Controller settings are saved')
45
51
  say_success(uri)
46
52
  end
@@ -189,6 +195,15 @@ module Uffizzi
189
195
  response.dig(:body, :controller_settings)
190
196
  end
191
197
 
198
+ def set_account_installation
199
+ params = {
200
+ installation_type: AccountService::SELF_HOSTED_CONTROLLER_INSTALLATION_TYPE,
201
+ }
202
+
203
+ response = update_account(server, account_name, params)
204
+ Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
205
+ end
206
+
192
207
  def update_controller_settings(controller_setting_id, params)
193
208
  response = update_account_controller_settings(server, account_id, controller_setting_id, params)
194
209
  Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
@@ -26,6 +26,7 @@ module Uffizzi
26
26
 
27
27
  ask_confirmation
28
28
  delete_controller_settings
29
+ unset_account_installation
29
30
  InstallService.helm_uninstall!(namespace)
30
31
 
31
32
  helm_unset_repo
@@ -75,6 +76,15 @@ module Uffizzi
75
76
  end
76
77
  end
77
78
 
79
+ def unset_account_installation
80
+ params = {
81
+ installation_type: nil,
82
+ }
83
+
84
+ response = update_account(server, account_name, params)
85
+ Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
86
+ end
87
+
78
88
  def namespace
79
89
  options[:namespace] || InstallService::DEFAULT_NAMESPACE
80
90
  end
@@ -87,6 +87,13 @@ module ApiClient
87
87
  build_response(response)
88
88
  end
89
89
 
90
+ def update_account(server, account_name, params)
91
+ uri = account_uri(server, account_name)
92
+ response = http_client.make_put_request(uri, params)
93
+
94
+ build_response(response)
95
+ end
96
+
90
97
  def create_project(server, account_id, params)
91
98
  uri = create_projects_uri(server, account_id)
92
99
  response = http_client.make_post_request(uri, params)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AccountService
4
+ SELF_HOSTED_CONTROLLER_INSTALLATION_TYPE = 'self_hosted_controller'
5
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uffizzi
4
- VERSION = '2.4.3'
4
+ VERSION = '2.4.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uffizzi-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-12-21 00:00:00.000000000 Z
12
+ date: 2023-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -450,6 +450,7 @@ files:
450
450
  - lib/uffizzi/helpers/project_helper.rb
451
451
  - lib/uffizzi/promt.rb
452
452
  - lib/uffizzi/response_helper.rb
453
+ - lib/uffizzi/services/account_service.rb
453
454
  - lib/uffizzi/services/cluster/common_service.rb
454
455
  - lib/uffizzi/services/cluster/create_service.rb
455
456
  - lib/uffizzi/services/cluster/delete_service.rb