kontena-cli 0.14.5 → 0.14.6
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10854e373ea991c16cef416e5148423e0f8e16f7
|
4
|
+
data.tar.gz: e207bfb58dab4e3e419f09281752228df9f7f835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f7c2b00ca9f065983bff7d18da412655be0bf1819ff3e0b27ef197a8b31e17ad30dcdcc209eb8226caa88c2c212d9b28e6e9c19b01989fb64eb0ff2f2030afb
|
7
|
+
data.tar.gz: a503b7cdc96de4171e17d5e241a91f342eef50eed0fa727665f923125f776c962775157d22f14d0797cbd7d42b044451853336c8b4d1e9957b7bb8ab94b46cde
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.14.
|
1
|
+
0.14.6
|
@@ -52,6 +52,7 @@ module Kontena::Cli::Apps
|
|
52
52
|
deploy = {}
|
53
53
|
deploy['wait_for_port'] = deploy_opts['wait_for_port'] if deploy_opts.has_key?('wait_for_port')
|
54
54
|
deploy['min_health'] = deploy_opts['min_health'] if deploy_opts.has_key?('min_health')
|
55
|
+
deploy['interval'] = parse_relative_time(deploy_opts['interval']) if deploy_opts.has_key?('interval')
|
55
56
|
unless deploy.empty?
|
56
57
|
data['deploy_opts'] = deploy
|
57
58
|
end
|
@@ -27,6 +27,7 @@ module Kontena::Cli::Apps::YAML
|
|
27
27
|
optional('strategy') { inclusion?(%w(ha daemon random)) }
|
28
28
|
optional('wait_for_port') { int? }
|
29
29
|
optional('min_health') { float? }
|
30
|
+
optional('interval') { format?(/^\d+(min|h|d|)$/) }
|
30
31
|
end
|
31
32
|
base.optional('hooks').schema do
|
32
33
|
optional('post_start').each do
|
@@ -324,6 +324,17 @@ describe Kontena::Cli::Apps::ServiceGenerator do
|
|
324
324
|
expect(result['strategy']).to eq('daemon')
|
325
325
|
end
|
326
326
|
|
327
|
+
it 'sets interval if deploy.interval is defined' do
|
328
|
+
data = {
|
329
|
+
'image' => 'foo/bar:latest',
|
330
|
+
'deploy' => {
|
331
|
+
'interval' => '1min'
|
332
|
+
}
|
333
|
+
}
|
334
|
+
result = subject.send(:parse_data, data)
|
335
|
+
expect(result['deploy_opts']['interval']).to eq(60)
|
336
|
+
end
|
337
|
+
|
327
338
|
it 'does not return deploy_opts if no deploy options are defined' do
|
328
339
|
data = {
|
329
340
|
'image' => 'foo/bar:latest'
|
@@ -62,6 +62,26 @@ describe Kontena::Cli::Apps::YAML::Validator do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
context 'deploy' do
|
66
|
+
it 'validates interval' do
|
67
|
+
|
68
|
+
result = subject.validate_options('deploy' => {'interval' => '1xyz'})
|
69
|
+
expect(result.messages.key?('deploy')).to be_truthy
|
70
|
+
|
71
|
+
result = subject.validate_options('deploy' => {'interval' => '1min'})
|
72
|
+
expect(result.messages.key?('deploy')).to be_falsey
|
73
|
+
|
74
|
+
result = subject.validate_options('deploy' => {'interval' => '1h'})
|
75
|
+
expect(result.messages.key?('deploy')).to be_falsey
|
76
|
+
|
77
|
+
result = subject.validate_options('deploy' => {'interval' => '1d'})
|
78
|
+
expect(result.messages.key?('deploy')).to be_falsey
|
79
|
+
|
80
|
+
result = subject.validate_options('deploy' => {'interval' => '100'})
|
81
|
+
expect(result.messages.key?('deploy')).to be_falsey
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
65
85
|
context 'command' do
|
66
86
|
it 'is optional' do
|
67
87
|
result = subject.validate_options({})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kontena-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kontena, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|