uffizzi-cli 2.4.10 → 2.4.12

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: 208b6ac1dfb59b5b76aac7cc0b4a21c8b4c725e8e843958fe10b98bdd50ec43f
4
- data.tar.gz: 7335a86326e93a84dbf67f31b3182d18a6fbf88a9e4ce4a4c04af265c68f3809
3
+ metadata.gz: fa50e209ee9414f0a1c978580419bebfc0a4b7bf708caae3ed0a3d0de6f6fcbe
4
+ data.tar.gz: '09539ddf6332d0c0ec8b2d3d6a88dddc3fb3212930a2e9d3ab26f16603c69b5e'
5
5
  SHA512:
6
- metadata.gz: 5302d2e8db9c5afb7c2550d45a15125d98efd472f8ae6902739b6900260719d213b1c71d79050e70018ad4381849155a2cc0730ae89d9af1f7268e10f08af7ab
7
- data.tar.gz: fbaf9bdba63f98ce1811d70e1388f9823baa32bf6bb28469e6e48a41d41d8b4e477b99addef053b290acfdc606f7ae5600c4ba77c2a5db4fed7356bca28c158c
6
+ metadata.gz: 596a54a49aa5bf51fc5dcc9ef69bde3fade802e33096c01f5420d2b6f9f0e7be7a9da594e59c61598442d39ed8029cc0dc6168e47294c1b6df09b56ca53957f6
7
+ data.tar.gz: 79ee7a703def19f480511a39388d4f89ff1d711ef25176118d444548bec21a94933018a6dd37cbb3948efc362e73188dd8637ea1d6bd44a254a421e315252606
@@ -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
@@ -7,7 +7,7 @@ require 'base64'
7
7
  class EnvVariablesService
8
8
  class << self
9
9
  def substitute_env_variables(compose_file_data)
10
- compose_file_data.gsub(/\${1,2}\{?([?:\-_A-Za-z0-9]+)\}?/) do |variable|
10
+ compose_file_data.gsub(/(?<![^ \t\n])\${1,2}\{?([?:\-_A-Za-z0-9]+)\}?/) do |variable|
11
11
  next variable if variable.start_with?('$$')
12
12
 
13
13
  variable_content = variable.match(/[?:\-_A-Za-z0-9]+/).to_s
@@ -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.12'
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
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.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
8
8
  - Grayson Adkins
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-06-26 00:00:00.000000000 Z
12
+ date: 2025-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -621,7 +621,7 @@ metadata:
621
621
  homepage_uri: https://uffizzi.com
622
622
  source_code_uri: https://github.com/UffizziCloud/uffizzi_cli
623
623
  changelog_uri: https://github.com/UffizziCloud/uffizzi_cli/blob/master/CHANGELOG.md
624
- post_install_message:
624
+ post_install_message:
625
625
  rdoc_options: []
626
626
  require_paths:
627
627
  - lib
@@ -636,8 +636,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
636
636
  - !ruby/object:Gem::Version
637
637
  version: '0'
638
638
  requirements: []
639
- rubygems_version: 3.3.5
640
- signing_key:
639
+ rubygems_version: 3.4.20
640
+ signing_key:
641
641
  specification_version: 4
642
642
  summary: uffizzi-cli
643
643
  test_files: []