kuber_kit 1.3.10 → 1.4.0

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: f3d479be6c693f7476c9cc4b461d68929a648cd0d9c396fcf13612ed2aa6dd26
4
- data.tar.gz: cf25c96fbcbcaa7a7fbc7ef30b5e792f470e01d4f30e195e36d1655ec2cc6d2e
3
+ metadata.gz: ea4d7b887247997ba8a4bac8015836186d752612b6965ba58b3e5800ddd8661c
4
+ data.tar.gz: d884b7c596db6fb835995e30d6873283bdd359430dbce69263c33c548b46941e
5
5
  SHA512:
6
- metadata.gz: faf29ebbb59fc01c28f38f4efe75210aedfe4064cc44df4fc963f412e9c6de8463c9447af24f88282cafe5f422ad348557a700461933672cdb0a525c881f4717
7
- data.tar.gz: da173ac98f30d156f5d95efd96701ddbf13caa4cb11cb9d67ee8802b5fc507ce1ad0592918e76fb5aad2964fd3b35658a74105eb113841049979aa27f8de43e8
6
+ metadata.gz: 97916e7cd453ea5b245b56700f60439736284a3deec759dc8f0b505b20ccbb2849998308e45adf0fa3440e0c48ed45a2bfcf98a2afb221836896d33d53f4e3be
7
+ data.tar.gz: 91af380e3e859112ed8bb19eb12911abd90edaf768389dd18d803ef0ab45a51f04327c9b9a401597ddcd0ec5fd6639cee009b624104e50349869c3b5f181b6b0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **1.4.0**
2
+ - Added opt-in deep-merge for configuration service_attributes. When `KuberKit::Container["configs"].deep_merge_service_attributes = true`, nested hashes (e.g. `env`) from a configuration's `service_attributes` are merged into the service's definition attributes instead of replacing them entirely. Arrays are still replaced, not concatenated. Disabled by default — existing behavior is unchanged.
3
+
1
4
  **1.3.8**
2
5
  - Deploy initializers separately first even if they are part of the initially requested list of services
3
6
 
@@ -5,8 +5,8 @@ class KuberKit::Configs
5
5
  :image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir, :remote_image_compile_dir,
6
6
  :kuber_kit_dirname, :kuber_kit_min_version, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
7
7
  :artifact_clone_dir, :service_config_dir, :deployer_strategy, :compile_simultaneous_limit, :deploy_simultaneous_limit,
8
- :additional_images_paths, :deprecation_warnings_disabled, :log_file_path, :env_file_compile_dir, :shell_launcher_strategy,
9
- :shell_launcher_sets_configration, :generator_strategy
8
+ :additional_images_paths, :deprecation_warnings_disabled, :log_file_path, :env_file_compile_dir, :shell_launcher_strategy,
9
+ :shell_launcher_sets_configration, :generator_strategy, :deep_merge_service_attributes
10
10
  ]
11
11
  DOCKER_IGNORE_LIST = [
12
12
  'Dockerfile',
@@ -58,6 +58,7 @@ class KuberKit::Configs
58
58
  set :deploy_simultaneous_limit, 5
59
59
  set :additional_images_paths, []
60
60
  set :deprecation_warnings_disabled, false
61
+ set :deep_merge_service_attributes, false
61
62
  set :log_file_path, File.join(absolute_kuber_kit_path, "deploy.log")
62
63
  set :env_file_compile_dir, File.join(absolute_kuber_kit_path, "env_files")
63
64
  set :shell_launcher_sets_configration, true
@@ -3,7 +3,12 @@ class KuberKit::Core::ServiceFactory
3
3
  service_attrs = definition.to_service_attrs
4
4
 
5
5
  configuration_attributes = KuberKit.current_configuration.service_attributes(service_attrs.name)
6
- attributes = (service_attrs.attributes || {}).merge(configuration_attributes)
6
+ base_attributes = service_attrs.attributes || {}
7
+ attributes = if KuberKit.deep_merge_service_attributes?
8
+ deep_merge(base_attributes, configuration_attributes)
9
+ else
10
+ base_attributes.merge(configuration_attributes)
11
+ end
7
12
 
8
13
  KuberKit::Core::Service.new(
9
14
  name: service_attrs.name,
@@ -16,4 +21,11 @@ class KuberKit::Core::ServiceFactory
16
21
  generator_strategy: service_attrs.generator_strategy,
17
22
  )
18
23
  end
19
- end
24
+
25
+ private
26
+ def deep_merge(base, override)
27
+ base.merge(override) do |_key, a, b|
28
+ a.is_a?(Hash) && b.is_a?(Hash) ? deep_merge(a, b) : b
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "1.3.10"
2
+ VERSION = "1.4.0"
3
3
  end
data/lib/kuber_kit.rb CHANGED
@@ -281,6 +281,10 @@ module KuberKit
281
281
  Container["configs"].deprecation_warnings_disabled
282
282
  end
283
283
 
284
+ def deep_merge_service_attributes?
285
+ Container["configs"].deep_merge_service_attributes
286
+ end
287
+
284
288
  def current_configuration
285
289
  if @configuration_name.nil?
286
290
  raise "Please set configuration name before calling current_configuration"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.10
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-02 00:00:00.000000000 Z
11
+ date: 2026-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts