kontena-cli 1.4.0.rc1 → 1.4.0.rc2

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
  SHA1:
3
- metadata.gz: 39d120e6b214cdeb9ec9e545caa38a90049150aa
4
- data.tar.gz: 7b1c08eda7f564c98b63147f869c6e3bef371be9
3
+ metadata.gz: f3520896ed976be156eb9509a49a55a8dc129dc7
4
+ data.tar.gz: eccc5f17766e2c451b991d2c6020209e28f750ce
5
5
  SHA512:
6
- metadata.gz: 9648681339d5d260ab68bc3dde7bbfad0ff4e6696a6d6d70ce6d6198fe383b3d1f5b6eee0a15e601801de4227a61c7ccfebb5847e0b956aaef0b16ceeeea896f
7
- data.tar.gz: a96851c14f507f48eafdee5704ec3e5fd22747c5ae7996ca43ed78e92fb33e3b41a9d7bde5415f89a6a4f32a4ea196928f1c1af545a16dd6995137ab84c3f0fd
6
+ metadata.gz: 1bef042707aaf438ed4a52aee5f296beb1bc95c0d0878af03d1d119c1358a9a51b0486c57ea4291db1f65b9a8ee8bd0ba83a74e0d2ad7140ae4a5cb507a7ef92
7
+ data.tar.gz: 3ba392ddaf00c0a6b3991dd8743f6970b8b2205ccd80f80c4e143704eb87998a9056b8ab219cdd7ed76c8d1d59881b2676e9ef001c4f59365d8a7ae87e3093a0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0.rc1
1
+ 1.4.0.rc2
@@ -45,6 +45,7 @@ module Kontena::Cli::Services
45
45
  option "--health-check-initial-delay", "DELAY", "Initial delay for health check"
46
46
  option "--health-check-port", "PORT", "Port for health check"
47
47
  option "--health-check-protocol", "PROTOCOL", "Protocol of health check"
48
+ option "--stop-signal", "STOP_SIGNAL", "Alternative signal to stop container"
48
49
  option "--stop-timeout", "STOP_TIMEOUT", "Timeout (duration) to stop a container"
49
50
  option "--read-only", :flag, "Read-only root fs for the container", default: false
50
51
 
@@ -95,6 +96,7 @@ module Kontena::Cli::Services
95
96
  health_check = parse_health_check
96
97
  data[:health_check] = health_check unless health_check.empty?
97
98
  data[:pid] = pid if pid
99
+ data[:stop_signal] = stop_signal if stop_signal
98
100
  data[:stop_grace_period] = stop_timeout if stop_timeout
99
101
  data[:read_only] = read_only?
100
102
  data
@@ -53,6 +53,9 @@ module Kontena
53
53
  puts " scaling: #{service['instances'] }"
54
54
  puts " strategy: #{service['strategy']}"
55
55
  puts " read_only: #{service['read_only'] == true ? 'yes' : 'no'}"
56
+ unless service['stop_signal'].to_s.empty?
57
+ puts " stop_signal: #{service['stop_signal']}"
58
+ end
56
59
  puts " stop_grace_period: #{service['stop_grace_period']}s"
57
60
  puts " deploy_opts:"
58
61
  if service['deploy_opts']['min_health']
@@ -42,6 +42,7 @@ module Kontena::Cli::Services
42
42
  option "--health-check-initial-delay", "DELAY", "Initial for HTTP health check"
43
43
  option "--health-check-port", "PORT", "Port for HTTP health check"
44
44
  option "--health-check-protocol", "PROTOCOL", "Protocol of health check"
45
+ option "--stop-signal", "STOP_SIGNAL", "Alternative signal to stop container"
45
46
  option "--stop-timeout", "STOP_TIMEOUT", "Timeout (duration) to stop a container"
46
47
 
47
48
  def execute
@@ -85,6 +86,7 @@ module Kontena::Cli::Services
85
86
  health_check = parse_health_check
86
87
  data[:health_check] = health_check unless health_check.empty?
87
88
  data[:pid] = pid if pid
89
+ data[:stop_signal] = stop_signal if stop_signal
88
90
  data[:stop_grace_period] = stop_timeout if stop_timeout
89
91
  data
90
92
  end
@@ -168,6 +168,7 @@ module Kontena
168
168
  Kernel.puts msg
169
169
  end
170
170
  end
171
+ Thread.main['spinners'].delete(spin_thread)
171
172
  end
172
173
 
173
174
  exit(status) if status
@@ -66,6 +66,7 @@ module Kontena::Cli::Stacks
66
66
  data['certificates'] = options['certificates'] if options['certificates']
67
67
  data['build'] = parse_build_options(options) if options['build']
68
68
  data['health_check'] = parse_health_check(options)
69
+ data['stop_signal'] = options['stop_signal'] if options['stop_signal']
69
70
  data['stop_grace_period'] = options['stop_grace_period'] if options['stop_grace_period']
70
71
  data['read_only'] = options['read_only'] || false
71
72
  data
@@ -80,6 +80,7 @@ module Kontena::Cli::Stacks::YAML
80
80
  'interval' => optional('integer'),
81
81
  'initial_delay' => optional('integer')
82
82
  }),
83
+ 'stop_signal' => optional('string'),
83
84
  'stop_grace_period' => optional(/(\d+(?:\.\d+)?)([hms])/),
84
85
  'read_only' => optional('boolean')
85
86
  }
@@ -16,7 +16,7 @@ module Kontena::Cli::Volumes
16
16
  end
17
17
 
18
18
  def fields
19
- quiet? ? ['id'] : %w(name scope driver created_at)
19
+ quiet? ? ['name'] : %w(name scope driver created_at)
20
20
  end
21
21
 
22
22
  def execute
@@ -25,6 +25,5 @@ module Kontena::Cli::Volumes
25
25
  row['created_at'] = time_ago(row['created_at'])
26
26
  end
27
27
  end
28
-
29
28
  end
30
29
  end
@@ -0,0 +1,50 @@
1
+ require 'kontena/cli/volumes/list_command'
2
+
3
+ describe Kontena::Cli::Volumes::ListCommand do
4
+ include ClientHelpers
5
+ include OutputHelpers
6
+ include RequirementsHelper
7
+
8
+ expect_to_require_current_master
9
+ expect_to_require_current_master_token
10
+
11
+ mock_current_master
12
+
13
+ let(:subject) { described_class.new("kontena") }
14
+ let(:response) do
15
+ {
16
+ 'volumes' => [
17
+ { 'id' => 'test-grid/testvol',
18
+ 'name' => 'testvol',
19
+ 'scope' => 'testscope',
20
+ 'driver' => 'testdriver',
21
+ 'created_at' => Time.parse('2001-01-01 12:00:00').to_s
22
+ },
23
+ { 'id' => 'test-grid/testvol2',
24
+ 'name' => 'testvol2',
25
+ 'scope' => 'testscope2',
26
+ 'driver' => 'testdriver2',
27
+ 'created_at' => Time.parse('2001-01-02 12:00:00').to_s
28
+ }
29
+ ]
30
+ }
31
+ end
32
+
33
+ it 'lists volumes' do
34
+ expect(client).to receive(:get).with('volumes/test-grid').and_return(response)
35
+ expect{subject.run(['--no-long'])}.to output_table [
36
+ ['testvol', 'testscope', 'testdriver', a_string_matching(/\d+ days ago/)],
37
+ ['testvol2', 'testscope2', 'testdriver2', a_string_matching(/\d+ days ago/)]
38
+ ]
39
+ end
40
+
41
+ context '--quiet' do
42
+ it 'lists volume names' do
43
+ expect(client).to receive(:get).with('volumes/test-grid').and_return(response)
44
+ expect{subject.run(['-q'])}.to output_table([
45
+ ['testvol'],
46
+ ['testvol2']
47
+ ]).without_header
48
+ end
49
+ end
50
+ end
@@ -55,7 +55,7 @@ module OutputHelpers
55
55
  @real.zip(@expected) do |real, expected|
56
56
  line += 1
57
57
  fields = real.split(/\s{2,}/)
58
- unless values_match?(fields, expected)
58
+ unless values_match?(expected, fields)
59
59
  @errors << [
60
60
  "on line #{line}:",
61
61
  " expected: #{expected}",
@@ -93,7 +93,7 @@ module OutputHelpers
93
93
  @expected = lines.flatten
94
94
  @actual = CaptureStdoutLines.capture(block)
95
95
 
96
- values_match?(@actual, @expected)
96
+ values_match?(@expected, @actual)
97
97
  end
98
98
  end
99
99
 
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: 1.4.0.rc1
4
+ version: 1.4.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -637,6 +637,7 @@ files:
637
637
  - spec/kontena/cli/vault/update_command_spec.rb
638
638
  - spec/kontena/cli/vault/write_command_spec.rb
639
639
  - spec/kontena/cli/version_command_spec.rb
640
+ - spec/kontena/cli/volumes/list_command_spec.rb
640
641
  - spec/kontena/cli/vpn/create_command_spec.rb
641
642
  - spec/kontena/client_spec.rb
642
643
  - spec/kontena/config_spec.rb
@@ -677,7 +678,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
677
678
  version: 1.3.1
678
679
  requirements: []
679
680
  rubyforge_project:
680
- rubygems_version: 2.6.13
681
+ rubygems_version: 2.6.14
681
682
  signing_key:
682
683
  specification_version: 4
683
684
  summary: Kontena command line tool
@@ -795,6 +796,7 @@ test_files:
795
796
  - spec/kontena/cli/vault/update_command_spec.rb
796
797
  - spec/kontena/cli/vault/write_command_spec.rb
797
798
  - spec/kontena/cli/version_command_spec.rb
799
+ - spec/kontena/cli/volumes/list_command_spec.rb
798
800
  - spec/kontena/cli/vpn/create_command_spec.rb
799
801
  - spec/kontena/client_spec.rb
800
802
  - spec/kontena/config_spec.rb