uffizzi-cli 2.4.2 → 2.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uffizzi/cli/install.rb +16 -1
- data/lib/uffizzi/cli/uninstall.rb +10 -0
- data/lib/uffizzi/clients/api/api_client.rb +7 -0
- data/lib/uffizzi/services/account_service.rb +5 -0
- data/lib/uffizzi/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: c0dca2ba03ac849c8e1ca71bac3c495b698fda210f888320b06bbac114eb2168
|
4
|
+
data.tar.gz: 1441cff7ebd668159423966a6b5a9604e8e377a45f8d027802c381814e297d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 310e1accb7217654da0e8d4f84364c2db240495d5c5d4df602f63a8ad87b72c798b8151817a44a95224599dfd312bd83875fd7a36e4430bb1aefdcbd5425a9f0
|
7
|
+
data.tar.gz: 262191965e225983bf075b45a878c49953f4f3955da4628ff64a39b5bc1641182e954a2c6d8bbc4a2808e3f4ba1382edc9b8cacfa36ac0d7de8db3bdf610c41a
|
data/lib/uffizzi/cli/install.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/uffizzi/version.rb
CHANGED
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.
|
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-
|
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
|