uffizzi_core 2.0.1 → 2.0.2

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: a8dde4ab08b392e84558c16e4967250af65c53920c983b1736df5af3091bbdac
4
- data.tar.gz: c7267a556db1b7132881ec0d9424eef05ce8dbbdf3b255456aba42bf0c38836c
3
+ metadata.gz: 5a1fdc0ffa4aadeeeac07ab3776a7f2dcc63f19968accc8d1820bb6b842a0877
4
+ data.tar.gz: 992b23980cc8e63db90b835f967bf2c1771d51019a17f805783fb6b2c4550b4f
5
5
  SHA512:
6
- metadata.gz: 27c1495b43f347282da5ac664db5485d4d4f5a751660ae502baa76b23990656546dcfb16f3221b48bf1d6f7f9fa8919d0b8e8a665e041cf05c446d95305ad82a
7
- data.tar.gz: 2a0b7ae8d5e85aa69bc1c93f8e9a9bf6658b19a33bec346ecf9296a8c7a8e8defa10b93be8ff381c296578a0b90d9be8c31b1b5d13fb7bc20b7f7a92c96ce53f
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)
@@ -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: [] }],
@@ -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
@@ -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.1'
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.1
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