uffizzi-cli 2.4.10 → 2.4.11

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
  SHA256:
3
- metadata.gz: 208b6ac1dfb59b5b76aac7cc0b4a21c8b4c725e8e843958fe10b98bdd50ec43f
4
- data.tar.gz: 7335a86326e93a84dbf67f31b3182d18a6fbf88a9e4ce4a4c04af265c68f3809
3
+ metadata.gz: 30f7c016d8af15ece13fcf170ef4b0cb244aba87837567b042e4d2d2cfba9512
4
+ data.tar.gz: 17ecf2ed0ba109eb515ad05695b92d0bccfe7ac535bd923e14d091ddc5feb814
5
5
  SHA512:
6
- metadata.gz: 5302d2e8db9c5afb7c2550d45a15125d98efd472f8ae6902739b6900260719d213b1c71d79050e70018ad4381849155a2cc0730ae89d9af1f7268e10f08af7ab
7
- data.tar.gz: fbaf9bdba63f98ce1811d70e1388f9823baa32bf6bb28469e6e48a41d41d8b4e477b99addef053b290acfdc606f7ae5600c4ba77c2a5db4fed7356bca28c158c
6
+ metadata.gz: 6482ab9cf846b47402a332de11f054c0c845efa472cf754e627c0b767c2926f5f9e5ffcbf604f34ccaa562fd551124c777e572b28a298cf96982d9cf7f0446c0
7
+ data.tar.gz: 685212d7f1102ed76976a330499e9ada8e0f9cf2e61a58fd01b65f240d2af66ac27f128c20bdc01d8b0dae06f014f947a7db2dd633481bce7471db616e43b6ee
@@ -20,9 +20,10 @@ module Uffizzi
20
20
  method_option :'node-selector-template', required: false, type: :string
21
21
  def controller(hostname)
22
22
  Uffizzi::AuthHelper.check_login
23
+ check_account_can_install
23
24
 
24
- # InstallService.kubectl_exists?
25
- # InstallService.helm_exists?
25
+ InstallService.kubectl_exists?
26
+ InstallService.helm_exists?
26
27
 
27
28
  if options[:context].present? && options[:context] != InstallService.kubeconfig_current_context
28
29
  InstallService.set_current_context(options[:context])
@@ -182,7 +183,18 @@ module Uffizzi
182
183
 
183
184
  def create_controller_settings(params)
184
185
  response = create_account_controller_settings(server, account_id, params)
185
- Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.created?(response)
186
+ unless Uffizzi::ResponseHelper.created?(response)
187
+ Uffizzi::ResponseHelper.handle_failed_response(response)
188
+ raise Uffizzi::Error.new
189
+ end
190
+ end
191
+
192
+ def check_account_can_install
193
+ response = check_can_install(server, account_id)
194
+ unless Uffizzi::ResponseHelper.ok?(response)
195
+ Uffizzi::ResponseHelper.handle_failed_response(response)
196
+ raise Uffizzi::Error.new
197
+ end
186
198
  end
187
199
 
188
200
  def build_controller_setting_params(uri, installation_options)
@@ -44,6 +44,14 @@ module ApiClient
44
44
  build_response(response)
45
45
  end
46
46
 
47
+ def check_can_install(server, account_id)
48
+ uri = account_can_install_uri(server, account_id)
49
+
50
+ response = http_client.make_get_request(uri)
51
+
52
+ build_response(response)
53
+ end
54
+
47
55
  def fetch_projects(server)
48
56
  uri = projects_uri(server)
49
57
  response = http_client.make_get_request(uri)
@@ -11,6 +11,10 @@ module ApiRoutes
11
11
  "#{server}/api/cli/v1/accounts/#{account_name}"
12
12
  end
13
13
 
14
+ def account_can_install_uri(server, account_id)
15
+ "#{server}/api/cli/v1/accounts/#{account_id}/check_can_install"
16
+ end
17
+
14
18
  def compose_file_uri(server, project_slug)
15
19
  "#{server}/api/cli/v1/projects/#{project_slug}/compose_file"
16
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uffizzi
4
- VERSION = '2.4.10'
4
+ VERSION = '2.4.11'
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.10
4
+ version: 2.4.11
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: 2024-06-26 00:00:00.000000000 Z
12
+ date: 2024-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport