uffizzi_core 2.3.0 → 2.3.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: 065d0c7c4ecaca71f48ed176e3a433a379908220e7923be4604165d2d6760fe7
4
- data.tar.gz: e79876e64df2b71896f0a34e40a7c1caf06b788914171a40e35b5feda33674d2
3
+ metadata.gz: 81b82f01fa3b61eea7546716b1d7bd696ada00810ab5ce6ca72bc6c609bb7266
4
+ data.tar.gz: da50fab31a969b5169a8025034603fb9500dc40c220a17a8fb98667f4ed14f3e
5
5
  SHA512:
6
- metadata.gz: 1415234d2f29321aae904e5467a41108b44f5beb8291e6510a60dc58f72597a535e00a0a1a98d6208844717b7ca0b2c53fe6560a163983583a7ab60cc382d4dc
7
- data.tar.gz: c1aea1bd41f011ad430ddd2c5af76d48518a2e4f099cb33615a4f81462a6cfee7777eeb80fef4607263cc403ed93580142db0166779002aa8272910da3d39f0d
6
+ metadata.gz: e2116c59a1f5d6f49f76bc08506e55a67bf7a8ebd4d38d5288f0d6f7664d36182206e30d33c42d88909ac7b9510122df3aa2c38cd6fd3ad6137640e213fb6a5d
7
+ data.tar.gz: 3573e168fe9af86a4d49b38b0d416cf856434c1d6a2d04ff7d1634f1947e3b25d0a34fdd72366c1f7b0e173d6a4718ed453e5f1c744b9d52a2b2e1a19c4bb360
@@ -2,6 +2,7 @@
2
2
 
3
3
  module UffizziCore::Concerns::Models::Container
4
4
  extend ActiveSupport::Concern
5
+ REQUEST_MEMORY_RATIO = 4
5
6
 
6
7
  # rubocop:disable Metrics/BlockLength
7
8
  included do
@@ -9,6 +9,7 @@ module UffizziCore::Concerns::Models::Deployment
9
9
  include UffizziCore::StateMachineConcern
10
10
  include UffizziCore::DeploymentRepo
11
11
  extend Enumerize
12
+ include UffizziCore::DependencyInjectionConcern
12
13
 
13
14
  self.table_name = UffizziCore.table_names[:deployments]
14
15
 
@@ -71,7 +72,8 @@ module UffizziCore::Concerns::Models::Deployment
71
72
  end
72
73
 
73
74
  def preview_url
74
- "#{subdomain}.#{Settings.app.managed_dns_zone}"
75
+ managed_dns_zone = controller_settings_service.deployment(self).managed_dns_zone
76
+ "#{subdomain}.#{managed_dns_zone}"
75
77
  end
76
78
 
77
79
  def namespace
@@ -29,6 +29,7 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
29
29
  is_ingress = ingress_container?(container_name, ingress_data)
30
30
  repo_attributes = repo_attributes(container_data, continuous_preview_global_data)
31
31
  additional_subdomains = is_ingress ? ingress_data.fetch(:additional_subdomains, []) : []
32
+ memory_limit = memory_limit(deploy_data)
32
33
 
33
34
  {
34
35
  tag: tag(image_data, repo_attributes),
@@ -40,8 +41,8 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
40
41
  command: command(container_data),
41
42
  variables: variables(environment, env_file_dependencies),
42
43
  secret_variables: secret_variables(secrets),
43
- memory_limit: memory(deploy_data),
44
- memory_request: memory(deploy_data),
44
+ memory_limit: memory_limit,
45
+ memory_request: memory_request(memory_limit),
45
46
  repo_attributes: repo_attributes,
46
47
  continuously_deploy: continuously_deploy(deploy_data),
47
48
  receive_incoming_requests: is_ingress,
@@ -161,7 +162,7 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
161
162
  command_data[:command_args].to_s
162
163
  end
163
164
 
164
- def memory(deploy_data)
165
+ def memory_limit(deploy_data)
165
166
  memory = deploy_data[:memory]
166
167
  return Settings.compose.default_memory if memory.nil?
167
168
 
@@ -184,6 +185,10 @@ class UffizziCore::ComposeFile::Builders::ContainerBuilderService
184
185
  memory_value
185
186
  end
186
187
 
188
+ def memory_request(memory)
189
+ memory / UffizziCore::Container::REQUEST_MEMORY_RATIO
190
+ end
191
+
187
192
  def continuously_deploy(deploy_data)
188
193
  return :disabled if deploy_data[:auto] == false
189
194
 
@@ -145,7 +145,7 @@ class UffizziCore::ControllerService
145
145
  def controller_client(deployable)
146
146
  settings = case deployable
147
147
  when UffizziCore::Deployment
148
- Settings.controller
148
+ controller_settings_service.deployment(deployable)
149
149
  when UffizziCore::Cluster
150
150
  controller_settings_service.vcluster(deployable)
151
151
  else
@@ -5,5 +5,11 @@ class UffizziCore::ControllerSettingsService
5
5
  def vcluster(_cluster)
6
6
  Settings.vcluster_controller
7
7
  end
8
+
9
+ def deployment(_cluster)
10
+ Settings.controller.deep_dup.tap do |s|
11
+ s.managed_dns_zone = Settings.app.managed_dns_zone
12
+ end
13
+ end
8
14
  end
9
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.3.0'
4
+ VERSION = '2.3.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.3.0
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-10-30 00:00:00.000000000 Z
12
+ date: 2023-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm