uffizzi_core 2.0.0 → 2.0.2

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: a39e41ef8a1ef0300ac30d802f223c0c99c8f771591569401ba7f8835bcfb095
4
- data.tar.gz: f3cb1e26f85f2751d7076234719d12a325eacab01ed4db85a6f7da8872442eb2
3
+ metadata.gz: 5a1fdc0ffa4aadeeeac07ab3776a7f2dcc63f19968accc8d1820bb6b842a0877
4
+ data.tar.gz: 992b23980cc8e63db90b835f967bf2c1771d51019a17f805783fb6b2c4550b4f
5
5
  SHA512:
6
- metadata.gz: 62647e990dd6c5c449993a851d69b2f72e4d8d391ccb5d24bdffd62a16e76f1784f1d2e0e75838b74a320166d12ac560011cce8d7fe28fcf3414e7910853b854
7
- data.tar.gz: cd2d7b36a7d231e6d090e29abced6c2617f0b950de0f9491e93d05e268c147102af90e6190e7cced76fe1678ec5f4dfbdd9242698c1eddb8bfb7ee07af8e1028
6
+ metadata.gz: 9dac4d2ec9bbae5bb2f322ed3311cc48b3471a3f05d13fa6e650e1c16e4f1f722318df5c2d20c31e77435bfa5aea91a4b7e0405276f2c4ea1800687e88e891f7
7
+ data.tar.gz: 3579e513b890716d21ae35c21bdb500eab2ee1677d49e6cffeffd75f5ef4c5aeddfbbf4e3563a544bf9d02a210a00424ea38980346d9fc7f6e1992dd96832ea5
@@ -27,6 +27,10 @@ module UffizziCore::DependencyInjectionConcern
27
27
  module_class(:password_protection)
28
28
  end
29
29
 
30
+ def find_ingress_parser_module
31
+ module_class(:ingress_parser)
32
+ end
33
+
30
34
  private
31
35
 
32
36
  def module_exists?(module_name)
@@ -17,7 +17,7 @@ class UffizziCore::Api::Cli::V1::Account::Credential::CreateForm < UffizziCore::
17
17
  end
18
18
 
19
19
  def check_credential_correctness
20
- errors.add(:username, :incorrect, type: type.text) unless UffizziCore::CredentialService.correct_credentials?(self)
20
+ errors.add(:username, :incorrect) unless UffizziCore::CredentialService.correct_credentials?(self)
21
21
  end
22
22
 
23
23
  def credential_exists?
@@ -18,6 +18,7 @@ class UffizziCore::Api::Cli::V1::Deployment::CreateForm < UffizziCore::Deploymen
18
18
  :receive_incoming_requests,
19
19
  :continuously_deploy,
20
20
  { variables: [:name, :value],
21
+ additional_subdomains: [],
21
22
  secret_variables: [:name, :value],
22
23
  volumes: [:source, :target, :type, :read_only],
23
24
  healthcheck: [:test, :interval, :timeout, :retries, :start_period, :disable, { test: [] }],
@@ -17,6 +17,7 @@ class UffizziCore::Api::Cli::V1::Deployment::UpdateForm < UffizziCore::Deploymen
17
17
  :receive_incoming_requests,
18
18
  :continuously_deploy,
19
19
  { variables: [:name, :value],
20
+ additional_subdomains: [],
20
21
  secret_variables: [:name, :value],
21
22
  volumes: [:source, :target, :type, :read_only],
22
23
  healthcheck: [:test, :interval, :timeout, :retries, :start_period, :disable, { test: [] }],
@@ -19,6 +19,7 @@ class UffizziCore::Api::Cli::V1::Template::CreateForm < UffizziCore::Template
19
19
  :service_name,
20
20
  :name,
21
21
  { variables: [:name, :value],
22
+ additional_subdomains: [],
22
23
  secret_variables: [:name, :value],
23
24
  volumes: [:source, :target, :type, :read_only],
24
25
  healthcheck: [:test, :interval, :timeout, :retries, :start_period, :disable, { test: [] }],
@@ -11,18 +11,6 @@ module UffizziCore::Concerns::Models::Credential
11
11
 
12
12
  self.table_name = UffizziCore.table_names[:credentials]
13
13
 
14
- const_set(:CREDENTIAL_TYPES, [
15
- UffizziCore::Credential::Amazon.name,
16
- UffizziCore::Credential::Azure.name,
17
- UffizziCore::Credential::DockerHub.name,
18
- UffizziCore::Credential::DockerRegistry.name,
19
- UffizziCore::Credential::GithubContainerRegistry.name,
20
- UffizziCore::Credential::Google.name,
21
- ])
22
-
23
- enumerize :type,
24
- in: self::CREDENTIAL_TYPES, i18n_scope: ['enumerize.credential.type']
25
-
26
14
  belongs_to :account
27
15
 
28
16
  before_destroy :remove_token
@@ -18,7 +18,8 @@ class UffizziCore::Controller::DeployContainers::ContainerSerializer < UffizziCo
18
18
  :receive_incoming_requests,
19
19
  :healthcheck,
20
20
  :volumes,
21
- :service_name
21
+ :service_name,
22
+ :additional_subdomains
22
23
 
23
24
  has_many :container_config_files
24
25
 
@@ -27,6 +27,7 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
27
27
  container_name)
28
28
  is_ingress = ingress_container?(container_name, ingress_data)
29
29
  repo_attributes = repo_attributes(container_data, continuous_preview_global_data)
30
+ additional_subdomains = is_ingress ? ingress_data[:additional_subdomains] : []
30
31
 
31
32
  {
32
33
  tag: tag(image_data, repo_attributes),
@@ -47,6 +48,7 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
47
48
  name: container_name,
48
49
  healthcheck: healthcheck_data,
49
50
  volumes: volumes_data,
51
+ additional_subdomains: additional_subdomains,
50
52
  }
51
53
  end
52
54
  # rubocop:enable Metrics/PerceivedComplexity
@@ -7,11 +7,12 @@ class UffizziCore::ComposeFile::Parsers::IngressParserService
7
7
 
8
8
  container_name = container_name(ingress_data, services_data)
9
9
  port = port(ingress_data)
10
+ additional_attributes = build_additional_attributes(ingress_data, services_data)
10
11
 
11
12
  {
12
13
  container_name: container_name,
13
14
  port: port,
14
- }
15
+ }.merge(additional_attributes)
15
16
  end
16
17
 
17
18
  private
@@ -47,5 +48,9 @@ class UffizziCore::ComposeFile::Parsers::IngressParserService
47
48
 
48
49
  port
49
50
  end
51
+
52
+ def build_additional_attributes(*)
53
+ {}
54
+ end
50
55
  end
51
56
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  class UffizziCore::ComposeFileService
4
4
  class << self
5
+ include UffizziCore::DependencyInjectionConcern
6
+
5
7
  def create(params, kind)
6
8
  compose_file_form = create_compose_form(params, kind)
7
9
 
@@ -31,7 +33,7 @@ class UffizziCore::ComposeFileService
31
33
  continuous_preview_data = UffizziCore::ComposeFile::Parsers::ContinuousPreviewParserService.parse(continuous_preview_option)
32
34
 
33
35
  ingress_option = UffizziCore::ComposeFile::ConfigOptionService.ingress_option(compose_data)
34
- ingress_data = UffizziCore::ComposeFile::Parsers::IngressParserService.parse(ingress_option, compose_data['services'])
36
+ ingress_data = parse_ingress(ingress_option, compose_data)
35
37
 
36
38
  {
37
39
  containers: containers_data,
@@ -40,6 +42,17 @@ class UffizziCore::ComposeFileService
40
42
  }
41
43
  end
42
44
 
45
+ def parse_ingress(ingress_option, compose_data)
46
+ ingress_parser_module = find_ingress_parser_module
47
+
48
+ unless ingress_parser_module
49
+ return UffizziCore::ComposeFile::Parsers::IngressParserService.parse(ingress_option,
50
+ compose_data['services'])
51
+ end
52
+
53
+ ingress_parser_module.parse(ingress_option, compose_data['services'])
54
+ end
55
+
43
56
  def build_template_attributes(compose_data, source, credentials, project, compose_dependencies = [], compose_repositories = [])
44
57
  builder = UffizziCore::ComposeFile::Builders::TemplateBuilderService.new(credentials, project, compose_repositories)
45
58
 
@@ -142,6 +142,6 @@ class UffizziCore::ManageActivityItemsService
142
142
  end
143
143
 
144
144
  def deployment_network_connectivity
145
- namespace_data&.metadata&.annotations&.network_connectivity || '{}'
145
+ namespace_data&.metadata&.annotations&.network_connectivity.presence || '{}'
146
146
  end
147
147
  end
@@ -13,7 +13,7 @@ en:
13
13
  password:
14
14
  password_blank: Password/Access Token can't be blank
15
15
  username:
16
- incorrect: "We were unable to log you into %{type}. Please verify that your username and password are correct."
16
+ incorrect: We were unable to log you in to docker registry. Please verify that your username and password are correct.
17
17
  type:
18
18
  exist: Credential of that type already exist.
19
19
  uffizzi_core/deployment:
@@ -76,12 +76,3 @@ en:
76
76
  session:
77
77
  unsupported_login_type: This type of login is not supported
78
78
  unauthorized: Unauthorized
79
- enumerize:
80
- credential:
81
- type:
82
- "UffizziCore::Credential::GithubContainerRegistry": "Github Container Registry"
83
- "UffizziCore::Credential::DockerHub": "DockerHub"
84
- "UffizziCore::Credential::DockerRegistry": "Docker Registry"
85
- "UffizziCore::Credential::Azure": "Azure"
86
- "UffizziCore::Credential::Google": "Google"
87
- "UffizziCore::Credential::Amazon": "Amazon"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddAdditionalSubdomainsToContainers < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column(:uffizzi_core_containers, :additional_subdomains, :string, array: true, default: [])
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uffizzi_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
@@ -521,6 +521,20 @@ dependencies:
521
521
  - - ">="
522
522
  - !ruby/object:Gem::Version
523
523
  version: '0'
524
+ - !ruby/object:Gem::Dependency
525
+ name: deepsort
526
+ requirement: !ruby/object:Gem::Requirement
527
+ requirements:
528
+ - - "~>"
529
+ - !ruby/object:Gem::Version
530
+ version: 0.4.5
531
+ type: :development
532
+ prerelease: false
533
+ version_requirements: !ruby/object:Gem::Requirement
534
+ requirements:
535
+ - - "~>"
536
+ - !ruby/object:Gem::Version
537
+ version: 0.4.5
524
538
  - !ruby/object:Gem::Dependency
525
539
  name: factory_bot
526
540
  requirement: !ruby/object:Gem::Requirement
@@ -987,6 +1001,7 @@ files:
987
1001
  - db/migrate/20220525113412_rename_name_to_uffizzi_containers.rb
988
1002
  - db/migrate/20220704135629_add_disabled_at_to_deployments.rb
989
1003
  - db/migrate/20220805164628_add_metadata_to_deployment.rb
1004
+ - db/migrate/20220927113647_add_additional_subdomains_to_containers.rb
990
1005
  - db/seeds.rb
991
1006
  - lib/tasks/uffizzi_core_tasks.rake
992
1007
  - lib/uffizzi_core.rb