pfab 0.58.15 → 0.58.17

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: baa23067a83f6210a2a67184580e090fbec35502652cc6a865608bc6f4bf2386
4
- data.tar.gz: b1c501abe3e6bbd78075225b37ac0c8fd7d9b3473659fc1857bd331e63b44f14
3
+ metadata.gz: 26d320a9f0e310c4807cc869b8d92435beebda0c6018b95f783853c70e35490c
4
+ data.tar.gz: 6cdb8a9994ad09267235514c85b1883cbe068559708e16a6c0b9aacf28d3bb2d
5
5
  SHA512:
6
- metadata.gz: e71028b3cdcf5f1bd9c207b3d40bfc0677723c35854664c6d5c7e7e019aa2b933f7115b63368a900b629ba0abce50532f8e0d352552d3e0c2a491514db80420c
7
- data.tar.gz: dba8d212b3ed55f9dbb0ecc14e9eed5b92e0b833c66bc97b79a90d8133eda5739262cc2f16bce813de2f627bc0862692f24456a3999d65730f50afa4ba1d45d2
6
+ metadata.gz: 98e8e05373073df2a8120cbbb24720c9a17f13a76f120a534225bdc731cb427007f59babf51a787825637fe8ae527e44435276a55cbcd241833928e5441da5dc
7
+ data.tar.gz: 0bfbd81ac1fd0011afd5d9ce4afb90b0ea93341105485e28260c34b4fc4c4212370a4a0c36ed2a41c00f7beada0a9163efee21eacabc55d4f7d69034c356252d
data/README.markdown CHANGED
@@ -249,5 +249,5 @@ Releasing
249
249
  Copyright
250
250
  ---------
251
251
 
252
- Copyright (c) 2023 Prefab Inc. See
252
+ Copyright (c) 2025 Prefab Inc. See
253
253
  LICENSE.txt for further details.
data/lib/pfab/cli.rb CHANGED
@@ -46,7 +46,11 @@ module Pfab
46
46
  c.option "--force", "force build and push"
47
47
  c.option "--check", "just check if built"
48
48
  c.action do |_args, options|
49
- cmd_build(force: options.force, checkonly: options.check)
49
+ if cmd_build(force: options.force, checkonly: options.check)
50
+ puts "Build succeeded"
51
+ else
52
+ raise "Build failed"
53
+ end
50
54
  end
51
55
  end
52
56
 
@@ -21,9 +21,7 @@ module Pfab
21
21
  puts "skipping ingress because ingress_disabled = #{@data['generateIngressEnabled']}"
22
22
  end
23
23
  f << StyledYAML.dump(deployment.deep_stringify_keys)
24
- if get_replica_count() > 1
25
- f << StyledYAML.dump(pod_disruption_budget.deep_stringify_keys)
26
- end
24
+ f << StyledYAML.dump(pod_disruption_budget.deep_stringify_keys)
27
25
  end
28
26
  end
29
27
 
@@ -151,6 +149,16 @@ module Pfab
151
149
  end
152
150
 
153
151
  def pod_disruption_budget
152
+ replica_count = get_replica_count()
153
+
154
+ # For single replica deployments, allow the pod to be disrupted
155
+ # For multi-replica deployments, ensure at least 50% of pods remain available
156
+ disruption_spec = if replica_count == 1
157
+ { maxUnavailable: 1 }
158
+ else
159
+ { minAvailable: (replica_count * 0.5).floor }
160
+ end
161
+
154
162
  pdb = {
155
163
  apiVersion: "policy/v1",
156
164
  kind: "PodDisruptionBudget",
@@ -158,16 +166,15 @@ module Pfab
158
166
  name: "#{@data['deployed_name']}-pdb",
159
167
  namespace: get_namespace()
160
168
  },
161
- spec: {
162
- minAvailable: 1,
169
+ spec: disruption_spec.merge({
163
170
  selector: {
164
- matchLabels: {
165
- application: @data['application'],
166
- "deployed-name" => @data['deployed_name'],
167
- "application-type" => application_type
171
+ matchLabels: {
172
+ application: @data['application'],
173
+ "deployed-name" => @data['deployed_name'],
174
+ "application-type" => application_type
168
175
  }
169
176
  }
170
- }
177
+ })
171
178
  }
172
179
  return pdb
173
180
  end
data/lib/pfab/version.rb CHANGED
@@ -2,7 +2,7 @@ module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 58
5
- PATCH = 15
5
+ PATCH = 17
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/pfab.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pfab 0.58.15 ruby lib
5
+ # stub: pfab 0.58.17 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pfab".freeze
9
- s.version = "0.58.15"
9
+ s.version = "0.58.17"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2025-04-08"
14
+ s.date = "2025-06-02"
15
15
  s.description = "k8s helper".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["pfab".freeze]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.15
4
+ version: 0.58.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-08 00:00:00.000000000 Z
11
+ date: 2025-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander