cuber 1.7.0 → 1.8.0

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: 687fb6dcbc68029a3b5f526d40afbea27d7a81c99d0609abeb294175daee01c0
4
- data.tar.gz: 201bef4d047a5bee19fe884414ec90b282f1606a8340cdb5ab6e7be4f6f585f5
3
+ metadata.gz: 8c28c18ed3acd87a99a88d336b9b729d4089efe1f97224b9bc4d16058a7ace8e
4
+ data.tar.gz: 36957c9449da91c15284dbd041edef524627c33dbf3252300049baf717f64c5b
5
5
  SHA512:
6
- metadata.gz: ae0bcb075fe4ebe29f607c01b95de94308bcfb586e12498a5c369ae0162d362d8661581d90bb3b9a4e759f9fe3489ffe5760f203bc98ad4cca7c674405ff4b76
7
- data.tar.gz: 30c8adb2b0ec54586b3402a5b5b9778c2ea4094c5f164e96de01641538dd9808e356e5f481fb18393f4276f614927b8bc81a69a8d308f00f3533416b29834f53
6
+ metadata.gz: 8498fc1f4c44b8e6fe4ed0939eec0e6229bb44e0dc66da2eb1e504e3304d0e2f74dc5d5ba40a123f884d9550fa584e245400cf0a1e3124beda52c0a078a48628
7
+ data.tar.gz: 2f76ecbc4462b448069ec251ccfebbc9c4def63ca4be2e2378d37e63b3db8df38ea889830b4a1ef0e73be51a9f2de418fc81bb3f83c5c79eb46080825a2706d8
data/lib/cuber/cli.rb CHANGED
@@ -27,7 +27,7 @@ module Cuber
27
27
  end
28
28
 
29
29
  def parse_cuberfile
30
- abort 'Cuberfile not found in current directory' unless File.exists? 'Cuberfile'
30
+ abort 'Cuberfile not found in current directory' unless File.exist? 'Cuberfile'
31
31
  content = File.read 'Cuberfile'
32
32
  parser = CuberfileParser.new
33
33
  parser.instance_eval(content)
@@ -98,7 +98,7 @@ module Cuber::Commands
98
98
  schedule = cron['spec']['schedule']
99
99
  command = cron['spec']['jobTemplate']['spec']['template']['spec']['containers'][0]['command'].shelljoin
100
100
  last = cron['status']['lastScheduleTime']
101
- puts "#{name}: #{schedule} #{command} (#{time_ago_in_words last})"
101
+ puts "#{name}: #{schedule} #{command} #{'(' + time_ago_in_words(last) + ')' if last}"
102
102
  end
103
103
  end
104
104
 
@@ -50,7 +50,7 @@ module Cuber
50
50
 
51
51
  def validate_dockerfile
52
52
  return unless @options[:dockerfile]
53
- @errors << 'dockerfile must be a file' unless File.exists? @options[:dockerfile]
53
+ @errors << 'dockerfile must be a file' unless File.exist? @options[:dockerfile]
54
54
  end
55
55
 
56
56
  def validate_image
@@ -64,12 +64,12 @@ module Cuber
64
64
 
65
65
  def validate_dockerconfig
66
66
  return unless @options[:dockerconfig]
67
- @errors << 'dockerconfig must be a file' unless File.exists? @options[:dockerconfig]
67
+ @errors << 'dockerconfig must be a file' unless File.exist? @options[:dockerconfig]
68
68
  end
69
69
 
70
70
  def validate_kubeconfig
71
71
  @errors << 'kubeconfig must be present' if @options[:kubeconfig].to_s.strip.empty?
72
- @errors << 'kubeconfig must be a file' unless File.exists? @options[:kubeconfig]
72
+ @errors << 'kubeconfig must be a file' unless File.exist? @options[:kubeconfig]
73
73
  end
74
74
 
75
75
  def validate_migrate
@@ -123,8 +123,8 @@ module Cuber
123
123
 
124
124
  def validate_ssl
125
125
  return unless @options[:ssl]
126
- @errors << 'ssl crt must be a file' unless File.exists? @options[:ssl][:crt]
127
- @errors << 'ssl key must be a file' unless File.exists? @options[:ssl][:key]
126
+ @errors << 'ssl crt must be a file' unless File.exist? @options[:ssl][:crt]
127
+ @errors << 'ssl key must be a file' unless File.exist? @options[:ssl][:key]
128
128
  end
129
129
 
130
130
  end
@@ -59,6 +59,23 @@ data:
59
59
  <%= key %>: <%= value.to_s.to_json %>
60
60
  <%- end -%>
61
61
 
62
+ ---
63
+ apiVersion: policy/v1
64
+ kind: PodDisruptionBudget
65
+ metadata:
66
+ name: web-pdb
67
+ namespace: <%= @options[:app] %>
68
+ labels:
69
+ app.kubernetes.io/name: <%= @options[:app] %>
70
+ app.kubernetes.io/instance: <%= @options[:instance] %>
71
+ app.kubernetes.io/version: <%= @options[:release] %>
72
+ app.kubernetes.io/managed-by: cuber
73
+ spec:
74
+ maxUnavailable: "50%"
75
+ selector:
76
+ matchLabels:
77
+ app: web-proc
78
+
62
79
  <%- if @options[:migrate] -%>
63
80
  ---
64
81
  apiVersion: batch/v1
@@ -168,11 +185,13 @@ spec:
168
185
  <%- if procname.to_s == 'web' && @options[:health] -%>
169
186
  readinessProbe:
170
187
  httpGet:
171
- path: <%= URI.parse(@options[:health]).path.to_json %>
172
188
  port: 8080
189
+ path: <%= URI.parse(@options[:health]).path.to_json %>
173
190
  httpHeaders:
174
191
  - name: Host
175
192
  value: <%= URI.parse(@options[:health]).host.to_json %>
193
+ - name: X-Forwarded-Proto
194
+ value: <%= URI.parse(@options[:health]).scheme.to_json %>
176
195
  <%- end -%>
177
196
  <%- if @options[:migrate] && @options[:migrate][:check] -%>
178
197
  initContainers:
data/lib/cuber/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cuber
2
- VERSION = '1.7.0'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: