kontena-cli 0.8.2 → 0.8.3

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: efd68ade38b20ae04c82f0a2e8f8e46a89246c37
4
- data.tar.gz: 99e574e391c502e13d546fe93b11c44c325435f0
3
+ metadata.gz: 53e09734eba57f7a68cc2ebc339d77f3b710466e
4
+ data.tar.gz: 08b06cfa424d9a0953c70f25c0cb6920f3cd8399
5
5
  SHA512:
6
- metadata.gz: ad488d3b1d339f22bad5c7f873139c690ad6e46461cc45c6e78c778ccf9062698fb6619c6ddc8cf36ec271274b415a58a45b8b6e8516f6865f67d12ef195f9cd
7
- data.tar.gz: 4638b07f4a4f45112fc1d1a4e4874500ecb3978496bc85a5e4a9cdf48485d9baef774461da07c048ae4a87de7555ffb9932c8502fe2ed5b91617ce9016129544
6
+ metadata.gz: dc7ff8d06d5ffee0905c99b9a9e14f32e7d965cbcc2406867504a6eb48963b3212783c70a4588477766c9246332596b80619d05dcb8530c608b6d4ef37e0e024
7
+ data.tar.gz: 3f4c3ebeda9537038f376f2a0ed03e226b9b629f6410ebc62292bdc4e6ea3c0e09176b723198c4a78d2efa25d48d3c570b41b35e98f500a5ee26f5a78c5052fc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.8.3
@@ -115,7 +115,7 @@ module Kontena::Cli::Apps
115
115
  # @param [Hash] options
116
116
  def parse_data(options)
117
117
  data = {}
118
- data[:image] = options['image']
118
+ data[:image] = parse_image(options['image'])
119
119
  data[:env] = options['environment']
120
120
  data[:container_count] = options['instances']
121
121
  data[:links] = parse_links(options['links']) if options['links']
@@ -53,7 +53,7 @@ module Kontena::Cli::Services
53
53
  data[:container_count] = instances if instances
54
54
  data[:cmd] = cmd.split(" ") if cmd
55
55
  data[:user] = user if user
56
- data[:image] = image if image
56
+ data[:image] = parse_image(image) if image
57
57
  data[:cap_add] = cap_add_list unless cap_add_list.empty?
58
58
  data[:cap_drop] = cap_drop_list unless cap_drop_list.empty?
59
59
  data
@@ -193,6 +193,15 @@ module Kontena
193
193
  memory.to_i
194
194
  end
195
195
  end
196
+
197
+ # @param [String] image
198
+ # @return [String]
199
+ def parse_image(image)
200
+ unless image.include?(":")
201
+ image = "#{image}:latest"
202
+ end
203
+ image
204
+ end
196
205
  end
197
206
  end
198
207
  end
@@ -42,7 +42,7 @@ module Kontena::Cli::Services
42
42
  data[:container_count] = instances if instances
43
43
  data[:cmd] = cmd.split(" ") if cmd
44
44
  data[:user] = user if user
45
- data[:image] = image if image
45
+ data[:image] = parse_image(image) if image
46
46
  data[:cap_add] = cap_add_list unless cap_add_list.empty?
47
47
  data[:cap_drop] = cap_drop_list unless cap_drop_list.empty?
48
48
  data
@@ -106,5 +106,15 @@ module Kontena::Cli::Services
106
106
  expect(subject.parse_service_id('second-grid/mysql')).to eq('second-grid/mysql')
107
107
  end
108
108
  end
109
+
110
+ describe '#parse_image' do
111
+ it 'adds :default tag if no tag exist' do
112
+ expect(subject.parse_image('nginx')).to eq('nginx:latest')
113
+ end
114
+
115
+ it 'does not touch image name if tag is set' do
116
+ expect(subject.parse_image('redis:3.0')).to eq('redis:3.0')
117
+ end
118
+ end
109
119
  end
110
120
  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.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler