kontena-cli 0.13.4 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/kontena-cli.gemspec +2 -0
- data/lib/kontena/cli/app_command.rb +2 -0
- data/lib/kontena/cli/apps/common.rb +80 -74
- data/lib/kontena/cli/apps/config_command.rb +29 -0
- data/lib/kontena/cli/apps/deploy_command.rb +12 -81
- data/lib/kontena/cli/apps/docker_helper.rb +3 -3
- data/lib/kontena/cli/apps/init_command.rb +0 -3
- data/lib/kontena/cli/apps/list_command.rb +2 -3
- data/lib/kontena/cli/apps/logs_command.rb +2 -3
- data/lib/kontena/cli/apps/monitor_command.rb +3 -4
- data/lib/kontena/cli/apps/remove_command.rb +4 -4
- data/lib/kontena/cli/apps/restart_command.rb +2 -3
- data/lib/kontena/cli/apps/scale_command.rb +3 -5
- data/lib/kontena/cli/apps/service_generator.rb +123 -0
- data/lib/kontena/cli/apps/service_generator_v2.rb +26 -0
- data/lib/kontena/cli/apps/show_command.rb +1 -2
- data/lib/kontena/cli/apps/start_command.rb +2 -3
- data/lib/kontena/cli/apps/stop_command.rb +2 -3
- data/lib/kontena/cli/apps/yaml/reader.rb +150 -0
- data/lib/kontena/cli/apps/yaml/service_extender.rb +60 -0
- data/lib/kontena/cli/apps/yaml/validations.rb +79 -0
- data/lib/kontena/cli/apps/yaml/validator.rb +55 -0
- data/lib/kontena/cli/apps/yaml/validator_v2.rb +74 -0
- data/lib/kontena/cli/common.rb +23 -0
- data/lib/kontena/cli/etcd/remove_command.rb +2 -0
- data/lib/kontena/cli/grids/remove_command.rb +2 -0
- data/lib/kontena/cli/grids/users/remove_command.rb +3 -0
- data/lib/kontena/cli/master/azure/create_command.rb +0 -2
- data/lib/kontena/cli/master/packet/create_command.rb +42 -0
- data/lib/kontena/cli/master/packet_command.rb +14 -0
- data/lib/kontena/cli/master/upcloud/create_command.rb +39 -0
- data/lib/kontena/cli/master/upcloud_command.rb +13 -0
- data/lib/kontena/cli/master/users/remove_command.rb +3 -0
- data/lib/kontena/cli/master/users/roles/remove_command.rb +2 -0
- data/lib/kontena/cli/master_command.rb +4 -0
- data/lib/kontena/cli/node_command.rb +4 -0
- data/lib/kontena/cli/nodes/azure/create_command.rb +0 -2
- data/lib/kontena/cli/nodes/list_command.rb +4 -8
- data/lib/kontena/cli/nodes/packet/create_command.rb +35 -0
- data/lib/kontena/cli/nodes/packet/restart_command.rb +17 -0
- data/lib/kontena/cli/nodes/packet/terminate_command.rb +20 -0
- data/lib/kontena/cli/nodes/packet_command.rb +15 -0
- data/lib/kontena/cli/nodes/remove_command.rb +2 -0
- data/lib/kontena/cli/nodes/show_command.rb +3 -1
- data/lib/kontena/cli/nodes/upcloud/create_command.rb +33 -0
- data/lib/kontena/cli/nodes/upcloud/restart_command.rb +20 -0
- data/lib/kontena/cli/nodes/upcloud/terminate_command.rb +20 -0
- data/lib/kontena/cli/nodes/upcloud_command.rb +15 -0
- data/lib/kontena/cli/registry/remove_command.rb +3 -0
- data/lib/kontena/cli/services/remove_command.rb +2 -0
- data/lib/kontena/cli/services/services_helper.rb +1 -0
- data/lib/kontena/cli/vault/list_command.rb +2 -0
- data/lib/kontena/cli/vault/read_command.rb +2 -0
- data/lib/kontena/cli/vault/remove_command.rb +4 -0
- data/lib/kontena/cli/vault/update_command.rb +8 -1
- data/lib/kontena/cli/vault/write_command.rb +2 -0
- data/lib/kontena/cli/vpn/remove_command.rb +3 -0
- data/lib/kontena/machine/azure/master_provisioner.rb +2 -2
- data/lib/kontena/machine/azure/node_provisioner.rb +7 -4
- data/lib/kontena/machine/digital_ocean/node_provisioner.rb +1 -1
- data/lib/kontena/machine/packet.rb +17 -0
- data/lib/kontena/machine/packet/cloudinit.yml +66 -0
- data/lib/kontena/machine/packet/cloudinit_master.yml +118 -0
- data/lib/kontena/machine/packet/master_provisioner.rb +93 -0
- data/lib/kontena/machine/packet/node_destroyer.rb +42 -0
- data/lib/kontena/machine/packet/node_provisioner.rb +77 -0
- data/lib/kontena/machine/packet/node_restarter.rb +41 -0
- data/lib/kontena/machine/packet/packet_common.rb +89 -0
- data/lib/kontena/machine/upcloud.rb +9 -0
- data/lib/kontena/machine/upcloud/cloudinit.yml +64 -0
- data/lib/kontena/machine/upcloud/cloudinit_master.yml +118 -0
- data/lib/kontena/machine/upcloud/master_provisioner.rb +136 -0
- data/lib/kontena/machine/upcloud/node_destroyer.rb +82 -0
- data/lib/kontena/machine/upcloud/node_provisioner.rb +119 -0
- data/lib/kontena/machine/upcloud/node_restarter.rb +47 -0
- data/lib/kontena/machine/upcloud/upcloud_common.rb +70 -0
- data/lib/kontena/scripts/completer +8 -3
- data/spec/fixtures/docker-compose_v2.yml +10 -0
- data/spec/fixtures/kontena-invalid.yml +4 -0
- data/spec/fixtures/kontena-with-variables.yml +19 -0
- data/spec/fixtures/kontena.yml +2 -2
- data/spec/fixtures/kontena_v2.yml +35 -0
- data/spec/kontena/cli/app/common_spec.rb +39 -101
- data/spec/kontena/cli/app/deploy_command_spec.rb +37 -388
- data/spec/kontena/cli/app/docker_helper_spec.rb +4 -4
- data/spec/kontena/cli/app/service_generator_spec.rb +374 -0
- data/spec/kontena/cli/app/service_generator_v2_spec.rb +74 -0
- data/spec/kontena/cli/app/yaml/reader_spec.rb +249 -0
- data/spec/kontena/cli/app/yaml/service_extender_spec.rb +104 -0
- data/spec/kontena/cli/app/yaml/validator_spec.rb +263 -0
- data/spec/kontena/cli/app/yaml/validator_v2_spec.rb +309 -0
- data/spec/kontena/cli/common_spec.rb +39 -1
- data/spec/kontena/cli/master/users/remove_command_spec.rb +9 -0
- data/spec/kontena/cli/master/users/roles/remove_command_spec.rb +2 -0
- metadata +86 -2
@@ -0,0 +1,309 @@
|
|
1
|
+
require_relative '../../../../spec_helper'
|
2
|
+
require 'kontena/cli/apps/yaml/validator_v2'
|
3
|
+
|
4
|
+
describe Kontena::Cli::Apps::YAML::ValidatorV2 do
|
5
|
+
describe '#validate_keys' do
|
6
|
+
it 'returns error on invalid key' do
|
7
|
+
result = subject.validate_keys('name' => 'wordpress')
|
8
|
+
expect(result['name'].size).to eq(1)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#validate_options' do
|
13
|
+
context 'build' do
|
14
|
+
it 'can be string' do
|
15
|
+
result = subject.validate_options('build' => '.')
|
16
|
+
expect(result.success?).to be_truthy
|
17
|
+
expect(result.messages.key?('build')).to be_falsey
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'can be hash' do
|
21
|
+
result = subject.validate_options('build' => { 'context' => '.' })
|
22
|
+
expect(result.success?).to be_truthy
|
23
|
+
expect(result.messages.key?('build')).to be_falsey
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns error if build is hash and context is missing' do
|
27
|
+
result = subject.validate_options('build' => {})
|
28
|
+
expect(result.success?).to be_falsey
|
29
|
+
expect(result.messages.key?('build')).to be_truthy
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'returns error if optional dockerfile is not string' do
|
33
|
+
result = subject.validate_options('build' => {
|
34
|
+
'context' => '.',
|
35
|
+
'dockerfile' => 123
|
36
|
+
})
|
37
|
+
expect(result.success?).to be_falsey
|
38
|
+
expect(result.messages.key?('build')).to be_truthy
|
39
|
+
end
|
40
|
+
end
|
41
|
+
it 'validates image is string' do
|
42
|
+
result = subject.validate_options('image' => true)
|
43
|
+
expect(result.success?).to be_falsey
|
44
|
+
expect(result.messages.key?('image')).to be_truthy
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'validates stateful is boolean' do
|
48
|
+
result = subject.validate_options('stateful' => 'bool')
|
49
|
+
expect(result.messages.key?('stateful')).to be_truthy
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'validates network_mode is host or bridge' do
|
53
|
+
result = subject.validate_options('network_mode' => 'invalid')
|
54
|
+
expect(result.messages.key?('network_mode')).to be_truthy
|
55
|
+
|
56
|
+
result = subject.validate_options('network_mode' => 'bridge')
|
57
|
+
expect(result.messages.key?('network_mode')).to be_falsey
|
58
|
+
|
59
|
+
result = subject.validate_options('network_mode' => 'host')
|
60
|
+
expect(result.messages.key?('network_mode')).to be_falsey
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'affinity' do
|
64
|
+
it 'is optional' do
|
65
|
+
result = subject.validate_options({})
|
66
|
+
expect(result.messages.key?('affinity')).to be_falsey
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'must be array' do
|
70
|
+
result = subject.validate_options('affinity' => 'node==node1')
|
71
|
+
expect(result.messages.key?('affinity')).to be_truthy
|
72
|
+
result = subject.validate_options('affinity' => ['node==node1'])
|
73
|
+
expect(result.messages.key?('affinity')).to be_falsey
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'validates format' do
|
77
|
+
result = subject.validate_options('affinity' => ['node=node1'])
|
78
|
+
expect(result.messages.key?('affinity')).to be_truthy
|
79
|
+
|
80
|
+
result = subject.validate_options('affinity' => ['node==node1', 'service!=mariadb'])
|
81
|
+
expect(result.messages.key?('affinity')).to be_falsey
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'command' do
|
86
|
+
it 'is optional' do
|
87
|
+
result = subject.validate_options({})
|
88
|
+
expect(result.messages.key?('command')).to be_falsey
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'must be string or empty' do
|
92
|
+
result = subject.validate_options('command' => 1234)
|
93
|
+
expect(result.messages.key?('command')).to be_truthy
|
94
|
+
|
95
|
+
result = subject.validate_options('command' => nil)
|
96
|
+
expect(result.messages.key?('command')).to be_falsey
|
97
|
+
|
98
|
+
result = subject.validate_options('command' => 'bundle exec rails s')
|
99
|
+
expect(result.messages.key?('command')).to be_falsey
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'validates cpu_shares is integer' do
|
104
|
+
result = subject.validate_options('cpu_shares' => '1m')
|
105
|
+
expect(result.messages.key?('cpu_shares')).to be_truthy
|
106
|
+
result = subject.validate_options('cpu_shares' => 1024)
|
107
|
+
expect(result.messages.key?('cpu_shares')).to be_falsey
|
108
|
+
result = subject.validate_options({})
|
109
|
+
expect(result.messages.key?('cpu_shares')).to be_falsey
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'validates environment is array or hash' do
|
113
|
+
result = subject.validate_options('environment' => 'KEY=VALUE')
|
114
|
+
expect(result.messages.key?('environment')).to be_truthy
|
115
|
+
result = subject.validate_options('environment' => ['KEY=VALUE'])
|
116
|
+
expect(result.messages.key?('environment')).to be_falsey
|
117
|
+
result = subject.validate_options('environment' => { 'KEY' => 'VALUE' })
|
118
|
+
expect(result.messages.key?('environment')).to be_falsey
|
119
|
+
end
|
120
|
+
|
121
|
+
context 'validates secrets' do
|
122
|
+
it 'must be array' do
|
123
|
+
result = subject.validate_options('secrets' => {})
|
124
|
+
expect(result.messages.key?('secrets')).to be_truthy
|
125
|
+
end
|
126
|
+
|
127
|
+
context 'item' do
|
128
|
+
it 'must contain secret' do
|
129
|
+
result = subject.validate_options('secrets' => [{ 'name' => 'test', 'type' => 'env' }])
|
130
|
+
expect(result.messages.key?('secrets')).to be_truthy
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'must contain name' do
|
134
|
+
result = subject.validate_options('secrets' => [{ 'secret' => 'test', 'type' => 'env' }])
|
135
|
+
expect(result.messages.key?('secrets')).to be_truthy
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'must contain type' do
|
139
|
+
result = subject.validate_options('secrets' => [{ 'secret' => 'test', 'name' => 'test' }])
|
140
|
+
expect(result.messages.key?('secrets')).to be_truthy
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'accepts valid input' do
|
144
|
+
result = subject.validate_options('secrets' =>
|
145
|
+
[
|
146
|
+
{
|
147
|
+
'secret' => 'test',
|
148
|
+
'name' => 'test',
|
149
|
+
'type' => 'env'
|
150
|
+
}
|
151
|
+
])
|
152
|
+
expect(result.messages.key?('secrets')).to be_falsey
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context 'logging' do
|
158
|
+
context 'options' do
|
159
|
+
it 'must be hash' do
|
160
|
+
result = subject.validate_options('logging' => { 'options' => [] })
|
161
|
+
expect(result.messages.key?('logging')).to be_truthy
|
162
|
+
data = {
|
163
|
+
'logging' => {
|
164
|
+
'options' => {
|
165
|
+
'syslog-address' => "tcp://192.168.0.42:123"
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
result = subject.validate_options(data)
|
170
|
+
expect(result.messages.key?('logging')).to be_falsey
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
context 'hooks' do
|
176
|
+
context 'validates pre_build' do
|
177
|
+
it 'must be array' do
|
178
|
+
result = subject.validate_options('hooks' => { 'pre_build' => {} })
|
179
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
180
|
+
data = {
|
181
|
+
'hooks' => {
|
182
|
+
'pre_build' => [
|
183
|
+
{
|
184
|
+
'cmd' => 'rake db:migrate'
|
185
|
+
}
|
186
|
+
]
|
187
|
+
}
|
188
|
+
}
|
189
|
+
result = subject.validate_options(data)
|
190
|
+
expect(result.messages.key?('hooks')).to be_falsey
|
191
|
+
end
|
192
|
+
end
|
193
|
+
context 'post_start' do
|
194
|
+
it 'must be array' do
|
195
|
+
result = subject.validate_options('hooks' => { 'post_start' => {} })
|
196
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
197
|
+
data = {
|
198
|
+
'hooks' => {
|
199
|
+
'post_start' => [
|
200
|
+
{
|
201
|
+
'name' => 'migrate',
|
202
|
+
'cmd' => 'rake db:migrate',
|
203
|
+
'instances' => '*'
|
204
|
+
}
|
205
|
+
]
|
206
|
+
}
|
207
|
+
}
|
208
|
+
result = subject.validate_options(data)
|
209
|
+
expect(result.messages.key?('hooks')).to be_falsey
|
210
|
+
end
|
211
|
+
|
212
|
+
context 'item' do
|
213
|
+
it 'must contain name' do
|
214
|
+
result = subject.validate_options('hooks' =>
|
215
|
+
{
|
216
|
+
'post_start' => [
|
217
|
+
{
|
218
|
+
'cmd' => 'rake db:migrate',
|
219
|
+
'instances' => '1'
|
220
|
+
}
|
221
|
+
]
|
222
|
+
})
|
223
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
224
|
+
end
|
225
|
+
|
226
|
+
it 'must contain cmd' do
|
227
|
+
result = subject.validate_options('hooks' =>
|
228
|
+
{
|
229
|
+
'post_start' => [
|
230
|
+
{
|
231
|
+
'name' => 'migrate',
|
232
|
+
'instances' => '1'
|
233
|
+
}
|
234
|
+
]
|
235
|
+
})
|
236
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
237
|
+
end
|
238
|
+
|
239
|
+
it 'must contain instance number or *' do
|
240
|
+
result = subject.validate_options('hooks' =>
|
241
|
+
{
|
242
|
+
'post_start' => [
|
243
|
+
{ 'name' => 'migrate',
|
244
|
+
'cmd' => 'rake db:migrate'
|
245
|
+
}
|
246
|
+
]
|
247
|
+
})
|
248
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
249
|
+
data = {
|
250
|
+
'hooks' => {
|
251
|
+
'post_start' => [
|
252
|
+
{
|
253
|
+
'name' => 'migrate',
|
254
|
+
'cmd' => 'rake db:migrate',
|
255
|
+
'instances' => 'all',
|
256
|
+
'oneshot' => true
|
257
|
+
}
|
258
|
+
]
|
259
|
+
}
|
260
|
+
}
|
261
|
+
result = subject.validate_options(data)
|
262
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
263
|
+
end
|
264
|
+
|
265
|
+
it 'may contain boolean oneshot' do
|
266
|
+
data = {
|
267
|
+
'hooks' => {
|
268
|
+
'post_start' => [
|
269
|
+
{
|
270
|
+
'name' => 'migrate',
|
271
|
+
'cmd' => 'rake db:migrate',
|
272
|
+
'instances' => '*',
|
273
|
+
'oneshot' => 'true'
|
274
|
+
}
|
275
|
+
]
|
276
|
+
}
|
277
|
+
}
|
278
|
+
result = subject.validate_options(data)
|
279
|
+
expect(result.messages.key?('hooks')).to be_truthy
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
it 'validates depends_on is array' do
|
284
|
+
result = subject.validate_options('depends_on' => 'web')
|
285
|
+
expect(result.messages.key?('depends_on')).to be_truthy
|
286
|
+
|
287
|
+
result = subject.validate_options('depends_on' => ['web'])
|
288
|
+
expect(result.messages.key?('depends_on')).to be_falsey
|
289
|
+
end
|
290
|
+
|
291
|
+
it 'validates volumes is array' do
|
292
|
+
result = subject.validate_options('volumes' => '/app')
|
293
|
+
expect(result.messages.key?('volumes')).to be_truthy
|
294
|
+
|
295
|
+
result = subject.validate_options('volumes' => ['/app'])
|
296
|
+
expect(result.messages.key?('volumes')).to be_falsey
|
297
|
+
end
|
298
|
+
|
299
|
+
it 'validates volumes_from is array' do
|
300
|
+
result = subject.validate_options('volumes_from' => 'mysql_data')
|
301
|
+
expect(result.messages.key?('volumes_from')).to be_truthy
|
302
|
+
|
303
|
+
result = subject.validate_options('volumes_from' => ['mysql_data'])
|
304
|
+
expect(result.messages.key?('volumes_from')).to be_falsey
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
@@ -89,7 +89,6 @@ describe Kontena::Cli::Common do
|
|
89
89
|
|
90
90
|
expect(subject.current_master['url']).to eq('someurl')
|
91
91
|
expect(subject.current_master['name']).to eq('alias')
|
92
|
-
|
93
92
|
end
|
94
93
|
end
|
95
94
|
|
@@ -122,4 +121,43 @@ describe Kontena::Cli::Common do
|
|
122
121
|
end
|
123
122
|
|
124
123
|
end
|
124
|
+
|
125
|
+
describe '#error' do
|
126
|
+
it 'prints error message to stderr if given and raise error' do
|
127
|
+
expect($stderr).to receive(:puts).with('error message!')
|
128
|
+
expect{subject.error('error message!')}.to raise_error(SystemExit)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
describe '#confirm_command' do
|
133
|
+
it 'returns true if input matches' do
|
134
|
+
allow(subject).to receive(:prompt).and_return('name-to-confirm')
|
135
|
+
|
136
|
+
expect(subject.confirm_command('name-to-confirm')).to be_truthy
|
137
|
+
expect{subject.confirm_command('name-to-confirm')}.to_not raise_error
|
138
|
+
end
|
139
|
+
|
140
|
+
it 'raises error unless input matches' do
|
141
|
+
expect(subject).to receive(:prompt).and_return('wrong-name')
|
142
|
+
expect(subject).to receive(:error).with(/did not match/)
|
143
|
+
|
144
|
+
subject.confirm_command('name-to-confirm')
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '#confirm' do
|
149
|
+
it 'returns true if confirmed' do
|
150
|
+
allow(subject).to receive(:prompt).and_return('y')
|
151
|
+
|
152
|
+
expect(subject.confirm).to be_truthy
|
153
|
+
expect{subject.confirm}.to_not raise_error
|
154
|
+
end
|
155
|
+
|
156
|
+
it 'raises error unless confirmed' do
|
157
|
+
expect(subject).to receive(:prompt).and_return('ei')
|
158
|
+
expect(subject).to receive(:error).with(/Aborted/)
|
159
|
+
|
160
|
+
subject.confirm
|
161
|
+
end
|
162
|
+
end
|
125
163
|
end
|
@@ -8,11 +8,20 @@ describe Kontena::Cli::Master::Users::RemoveCommand do
|
|
8
8
|
|
9
9
|
describe '#execute' do
|
10
10
|
|
11
|
+
before(:each) do
|
12
|
+
allow(subject).to receive(:confirm).and_return(true)
|
13
|
+
end
|
14
|
+
|
11
15
|
it 'requires api url' do
|
12
16
|
expect(subject).to receive(:require_api_url).once
|
13
17
|
subject.run(['john@domain.com'])
|
14
18
|
end
|
15
19
|
|
20
|
+
it 'it requires confirmation' do
|
21
|
+
expect(subject).to receive(:confirm).once
|
22
|
+
subject.run(['john@domain.com'])
|
23
|
+
end
|
24
|
+
|
16
25
|
it 'requires token' do
|
17
26
|
expect(subject).to receive(:require_token).and_return(token)
|
18
27
|
subject.run(['john@domain.com'])
|
@@ -23,11 +23,13 @@ describe Kontena::Cli::Master::Users::Roles::RemoveCommand do
|
|
23
23
|
before(:each) do
|
24
24
|
allow(subject).to receive(:client).and_return(client)
|
25
25
|
allow(subject).to receive(:settings).and_return(valid_settings)
|
26
|
+
allow(subject).to receive(:confirm).and_return(true)
|
26
27
|
end
|
27
28
|
|
28
29
|
it 'makes remove role request for all given users' do
|
29
30
|
expect(client).to receive(:delete).with("users/john@example.org/roles/role").once
|
30
31
|
expect(client).to receive(:delete).with("users/jane@example.org/roles/role").once
|
32
|
+
expect(subject).to receive(:confirm).once
|
31
33
|
|
32
34
|
subject.run(['role', 'john@example.org', 'jane@example.org'])
|
33
35
|
end
|
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.
|
4
|
+
version: 0.14.0
|
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-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,6 +122,34 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: dry-validation
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.7.4
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.7.4
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: dry-logic
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.2.2
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.2.2
|
125
153
|
description: Kontena command line tool
|
126
154
|
email:
|
127
155
|
- info@kontena.io
|
@@ -143,6 +171,7 @@ files:
|
|
143
171
|
- lib/kontena/cli/app_command.rb
|
144
172
|
- lib/kontena/cli/apps/build_command.rb
|
145
173
|
- lib/kontena/cli/apps/common.rb
|
174
|
+
- lib/kontena/cli/apps/config_command.rb
|
146
175
|
- lib/kontena/cli/apps/deploy_command.rb
|
147
176
|
- lib/kontena/cli/apps/docker_compose_generator.rb
|
148
177
|
- lib/kontena/cli/apps/docker_helper.rb
|
@@ -155,9 +184,16 @@ files:
|
|
155
184
|
- lib/kontena/cli/apps/remove_command.rb
|
156
185
|
- lib/kontena/cli/apps/restart_command.rb
|
157
186
|
- lib/kontena/cli/apps/scale_command.rb
|
187
|
+
- lib/kontena/cli/apps/service_generator.rb
|
188
|
+
- lib/kontena/cli/apps/service_generator_v2.rb
|
158
189
|
- lib/kontena/cli/apps/show_command.rb
|
159
190
|
- lib/kontena/cli/apps/start_command.rb
|
160
191
|
- lib/kontena/cli/apps/stop_command.rb
|
192
|
+
- lib/kontena/cli/apps/yaml/reader.rb
|
193
|
+
- lib/kontena/cli/apps/yaml/service_extender.rb
|
194
|
+
- lib/kontena/cli/apps/yaml/validations.rb
|
195
|
+
- lib/kontena/cli/apps/yaml/validator.rb
|
196
|
+
- lib/kontena/cli/apps/yaml/validator_v2.rb
|
161
197
|
- lib/kontena/cli/bytes_helper.rb
|
162
198
|
- lib/kontena/cli/common.rb
|
163
199
|
- lib/kontena/cli/container_command.rb
|
@@ -207,6 +243,10 @@ files:
|
|
207
243
|
- lib/kontena/cli/master/digital_ocean/create_command.rb
|
208
244
|
- lib/kontena/cli/master/digital_ocean_command.rb
|
209
245
|
- lib/kontena/cli/master/list_command.rb
|
246
|
+
- lib/kontena/cli/master/packet/create_command.rb
|
247
|
+
- lib/kontena/cli/master/packet_command.rb
|
248
|
+
- lib/kontena/cli/master/upcloud/create_command.rb
|
249
|
+
- lib/kontena/cli/master/upcloud_command.rb
|
210
250
|
- lib/kontena/cli/master/use_command.rb
|
211
251
|
- lib/kontena/cli/master/users/invite_command.rb
|
212
252
|
- lib/kontena/cli/master/users/list_command.rb
|
@@ -240,9 +280,17 @@ files:
|
|
240
280
|
- lib/kontena/cli/nodes/labels/add_command.rb
|
241
281
|
- lib/kontena/cli/nodes/labels/remove_command.rb
|
242
282
|
- lib/kontena/cli/nodes/list_command.rb
|
283
|
+
- lib/kontena/cli/nodes/packet/create_command.rb
|
284
|
+
- lib/kontena/cli/nodes/packet/restart_command.rb
|
285
|
+
- lib/kontena/cli/nodes/packet/terminate_command.rb
|
286
|
+
- lib/kontena/cli/nodes/packet_command.rb
|
243
287
|
- lib/kontena/cli/nodes/remove_command.rb
|
244
288
|
- lib/kontena/cli/nodes/show_command.rb
|
245
289
|
- lib/kontena/cli/nodes/ssh_command.rb
|
290
|
+
- lib/kontena/cli/nodes/upcloud/create_command.rb
|
291
|
+
- lib/kontena/cli/nodes/upcloud/restart_command.rb
|
292
|
+
- lib/kontena/cli/nodes/upcloud/terminate_command.rb
|
293
|
+
- lib/kontena/cli/nodes/upcloud_command.rb
|
246
294
|
- lib/kontena/cli/nodes/update_command.rb
|
247
295
|
- lib/kontena/cli/nodes/vagrant/create_command.rb
|
248
296
|
- lib/kontena/cli/nodes/vagrant/restart_command.rb
|
@@ -327,7 +375,23 @@ files:
|
|
327
375
|
- lib/kontena/machine/digital_ocean/master_provisioner.rb
|
328
376
|
- lib/kontena/machine/digital_ocean/node_destroyer.rb
|
329
377
|
- lib/kontena/machine/digital_ocean/node_provisioner.rb
|
378
|
+
- lib/kontena/machine/packet.rb
|
379
|
+
- lib/kontena/machine/packet/cloudinit.yml
|
380
|
+
- lib/kontena/machine/packet/cloudinit_master.yml
|
381
|
+
- lib/kontena/machine/packet/master_provisioner.rb
|
382
|
+
- lib/kontena/machine/packet/node_destroyer.rb
|
383
|
+
- lib/kontena/machine/packet/node_provisioner.rb
|
384
|
+
- lib/kontena/machine/packet/node_restarter.rb
|
385
|
+
- lib/kontena/machine/packet/packet_common.rb
|
330
386
|
- lib/kontena/machine/random_name.rb
|
387
|
+
- lib/kontena/machine/upcloud.rb
|
388
|
+
- lib/kontena/machine/upcloud/cloudinit.yml
|
389
|
+
- lib/kontena/machine/upcloud/cloudinit_master.yml
|
390
|
+
- lib/kontena/machine/upcloud/master_provisioner.rb
|
391
|
+
- lib/kontena/machine/upcloud/node_destroyer.rb
|
392
|
+
- lib/kontena/machine/upcloud/node_provisioner.rb
|
393
|
+
- lib/kontena/machine/upcloud/node_restarter.rb
|
394
|
+
- lib/kontena/machine/upcloud/upcloud_common.rb
|
331
395
|
- lib/kontena/machine/vagrant.rb
|
332
396
|
- lib/kontena/machine/vagrant/Vagrantfile.master.rb.erb
|
333
397
|
- lib/kontena/machine/vagrant/Vagrantfile.node.rb.erb
|
@@ -339,7 +403,11 @@ files:
|
|
339
403
|
- lib/kontena/scripts/completer
|
340
404
|
- lib/kontena/scripts/init
|
341
405
|
- spec/fixtures/docker-compose.yml
|
406
|
+
- spec/fixtures/docker-compose_v2.yml
|
407
|
+
- spec/fixtures/kontena-invalid.yml
|
408
|
+
- spec/fixtures/kontena-with-variables.yml
|
342
409
|
- spec/fixtures/kontena.yml
|
410
|
+
- spec/fixtures/kontena_v2.yml
|
343
411
|
- spec/fixtures/mysql.yml
|
344
412
|
- spec/fixtures/wordpress-scaled.yml
|
345
413
|
- spec/fixtures/wordpress.yml
|
@@ -347,6 +415,12 @@ files:
|
|
347
415
|
- spec/kontena/cli/app/deploy_command_spec.rb
|
348
416
|
- spec/kontena/cli/app/docker_helper_spec.rb
|
349
417
|
- spec/kontena/cli/app/scale_spec.rb
|
418
|
+
- spec/kontena/cli/app/service_generator_spec.rb
|
419
|
+
- spec/kontena/cli/app/service_generator_v2_spec.rb
|
420
|
+
- spec/kontena/cli/app/yaml/reader_spec.rb
|
421
|
+
- spec/kontena/cli/app/yaml/service_extender_spec.rb
|
422
|
+
- spec/kontena/cli/app/yaml/validator_spec.rb
|
423
|
+
- spec/kontena/cli/app/yaml/validator_v2_spec.rb
|
350
424
|
- spec/kontena/cli/common_spec.rb
|
351
425
|
- spec/kontena/cli/grids/trusted_subnets/add_command_spec.rb
|
352
426
|
- spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
|
@@ -397,7 +471,11 @@ specification_version: 4
|
|
397
471
|
summary: Kontena command line tool
|
398
472
|
test_files:
|
399
473
|
- spec/fixtures/docker-compose.yml
|
474
|
+
- spec/fixtures/docker-compose_v2.yml
|
475
|
+
- spec/fixtures/kontena-invalid.yml
|
476
|
+
- spec/fixtures/kontena-with-variables.yml
|
400
477
|
- spec/fixtures/kontena.yml
|
478
|
+
- spec/fixtures/kontena_v2.yml
|
401
479
|
- spec/fixtures/mysql.yml
|
402
480
|
- spec/fixtures/wordpress-scaled.yml
|
403
481
|
- spec/fixtures/wordpress.yml
|
@@ -405,6 +483,12 @@ test_files:
|
|
405
483
|
- spec/kontena/cli/app/deploy_command_spec.rb
|
406
484
|
- spec/kontena/cli/app/docker_helper_spec.rb
|
407
485
|
- spec/kontena/cli/app/scale_spec.rb
|
486
|
+
- spec/kontena/cli/app/service_generator_spec.rb
|
487
|
+
- spec/kontena/cli/app/service_generator_v2_spec.rb
|
488
|
+
- spec/kontena/cli/app/yaml/reader_spec.rb
|
489
|
+
- spec/kontena/cli/app/yaml/service_extender_spec.rb
|
490
|
+
- spec/kontena/cli/app/yaml/validator_spec.rb
|
491
|
+
- spec/kontena/cli/app/yaml/validator_v2_spec.rb
|
408
492
|
- spec/kontena/cli/common_spec.rb
|
409
493
|
- spec/kontena/cli/grids/trusted_subnets/add_command_spec.rb
|
410
494
|
- spec/kontena/cli/grids/trusted_subnets/list_command_spec.rb
|