kontena-cli 0.8.1 → 0.8.2

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: 16045824a8737f120ba0e57060bc936312d24c49
4
- data.tar.gz: 8e71615acaa226eef9abb0c4dc2248e0b707a049
3
+ metadata.gz: efd68ade38b20ae04c82f0a2e8f8e46a89246c37
4
+ data.tar.gz: 99e574e391c502e13d546fe93b11c44c325435f0
5
5
  SHA512:
6
- metadata.gz: c2da530ae315278855bbb2c3e95c5acb29977f2f27ecac14eb3cf7834c4d08fb31a47da836b0e7d22b451b49896c46f8a328d4b6a4931350fd668e9dddbd8232
7
- data.tar.gz: c8cba0fcfab582c66dc604b660680a3625b939e0f55e5bdfebada0be318c26615716e917452e40fb61ff3ec28c985853f55ffa1c0af8640db198d147924270f0
6
+ metadata.gz: ad488d3b1d339f22bad5c7f873139c690ad6e46461cc45c6e78c778ccf9062698fb6619c6ddc8cf36ec271274b415a58a45b8b6e8516f6865f67d12ef195f9cd
7
+ data.tar.gz: 4638b07f4a4f45112fc1d1a4e4874500ecb3978496bc85a5e4a9cdf48485d9baef774461da07c048ae4a87de7555ffb9932c8502fe2ed5b91617ce9016129544
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.8.2
@@ -36,27 +36,27 @@ module Kontena::Cli::Registry
36
36
  abort('--s3-secret-key is missing') if s3_secret_key.nil?
37
37
  abort('--s3-bucket is missing') if s3_bucket.nil?
38
38
  env = [
39
- "REGISTRY_STORAGE=s3",
40
- "REGISTRY_STORAGE_S3_ACCESSKEY=#{opts.s3_access_key}",
41
- "REGISTRY_STORAGE_S3_SECRETKEY=#{opts.s3_secret_key}",
42
- "REGISTRY_STORAGE_S3_REGION=#{s3_region}",
43
- "REGISTRY_STORAGE_S3_BUCKET=#{opts.s3_bucket}",
44
- "REGISTRY_STORAGE_S3_ENCRYPT=#{s3_encrypt}",
45
- "REGISTRY_STORAGE_S3_SECURE=#{s3_secure}",
39
+ "REGISTRY_STORAGE=s3",
40
+ "REGISTRY_STORAGE_S3_ACCESSKEY=#{s3_access_key}",
41
+ "REGISTRY_STORAGE_S3_SECRETKEY=#{s3_secret_key}",
42
+ "REGISTRY_STORAGE_S3_REGION=#{s3_region}",
43
+ "REGISTRY_STORAGE_S3_BUCKET=#{s3_bucket}",
44
+ "REGISTRY_STORAGE_S3_ENCRYPT=#{s3_encrypt?}",
45
+ "REGISTRY_STORAGE_S3_SECURE=#{s3_secure?}",
46
46
  ]
47
47
  elsif azure_account_name || azure_account_key
48
48
  abort('--azure-account-name is missing') if azure_account_name.nil?
49
49
  abort('--azure-account-key is missing') if azure_account_key.nil?
50
50
  abort('--azure-container-name is missing') if azure_container_name.nil?
51
51
  env = [
52
- "REGISTRY_STORAGE=azure",
53
- "REGISTRY_STORAGE_AZURE_ACCOUNTNAME=#{opts.azure_account_name}",
54
- "REGISTRY_STORAGE_AZURE_ACCOUNTKEY=#{opts.azure_account_key}",
55
- "REGISTRY_STORAGE_AZURE_CONTAINERNAME=#{opts.azure_container_name}"
52
+ "REGISTRY_STORAGE=azure",
53
+ "REGISTRY_STORAGE_AZURE_ACCOUNTNAME=#{azure_account_name}",
54
+ "REGISTRY_STORAGE_AZURE_ACCOUNTKEY=#{azure_account_key}",
55
+ "REGISTRY_STORAGE_AZURE_CONTAINERNAME=#{azure_container_name}"
56
56
  ]
57
57
  else
58
58
  env = [
59
- "REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/registry"
59
+ "REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/registry"
60
60
  ]
61
61
  end
62
62
 
@@ -64,12 +64,12 @@ module Kontena::Cli::Registry
64
64
  env << "AUTH_PASSWORD=#{auth_password}" if auth_password
65
65
 
66
66
  data = {
67
- name: 'registry',
68
- stateful: true,
69
- image: 'kontena/registry:2.1',
70
- volumes: ['/registry'],
71
- env: env,
72
- affinity: ["node==#{node['name']}"]
67
+ name: 'registry',
68
+ stateful: true,
69
+ image: 'kontena/registry:2.1',
70
+ volumes: ['/registry'],
71
+ env: env,
72
+ affinity: ["node==#{node['name']}"]
73
73
  }
74
74
  client(token).post("grids/#{current_grid}/services", data)
75
75
  result = client(token).post("services/#{current_grid}/registry/deploy", {})
@@ -41,21 +41,21 @@ module Kontena::Cli::Services
41
41
  # @return [Hash]
42
42
  def parse_service_data_from_options
43
43
  data = {}
44
- data[:ports] = parse_ports(ports_list) if ports_list
45
- data[:links] = parse_links(link_list) if link_list
46
- data[:volumes] = volume_list if volume_list
47
- data[:volumes_from] = volumes_from_list if volumes_from_list
44
+ data[:ports] = parse_ports(ports_list) unless ports_list.empty?
45
+ data[:links] = parse_links(link_list) unless link_list.empty?
46
+ data[:volumes] = volume_list unless volume_list.empty?
47
+ data[:volumes_from] = volumes_from_list unless volumes_from_list.empty?
48
48
  data[:memory] = parse_memory(memory) if memory
49
49
  data[:memory_swap] = parse_memory(memory_swap) if memory_swap
50
50
  data[:cpu_shares] = cpu_shares if cpu_shares
51
- data[:affinity] = affinity_list if affinity_list
52
- data[:env] = env_list if env_list
51
+ data[:affinity] = affinity_list unless affinity_list.empty?
52
+ data[:env] = env_list unless env_list.empty?
53
53
  data[:container_count] = instances if instances
54
54
  data[:cmd] = cmd.split(" ") if cmd
55
55
  data[:user] = user if user
56
56
  data[:image] = image if image
57
- data[:cap_add] = cap_add_list if cap_add_list
58
- data[:cap_drop] = cap_drop_list if cap_drop_list
57
+ data[:cap_add] = cap_add_list unless cap_add_list.empty?
58
+ data[:cap_drop] = cap_drop_list unless cap_drop_list.empty?
59
59
  data
60
60
  end
61
61
  end
@@ -33,18 +33,18 @@ module Kontena::Cli::Services
33
33
  # @return [Hash]
34
34
  def parse_service_data_from_options
35
35
  data = {}
36
- data[:ports] = parse_ports(ports_list) if ports_list
36
+ data[:ports] = parse_ports(ports_list) unless ports_list.empty?
37
37
  data[:memory] = parse_memory(memory) if memory
38
38
  data[:memory_swap] = parse_memory(memory_swap) if memory_swap
39
39
  data[:cpu_shares] = cpu_shares if cpu_shares
40
- data[:affinity] = affinity_list if affinity_list
41
- data[:env] = env_list if env_list
40
+ data[:affinity] = affinity_list unless affinity_list.empty?
41
+ data[:env] = env_list unless env_list.empty?
42
42
  data[:container_count] = instances if instances
43
43
  data[:cmd] = cmd.split(" ") if cmd
44
44
  data[:user] = user if user
45
45
  data[:image] = image if image
46
- data[:cap_add] = cap_add_list if cap_add_list
47
- data[:cap_drop] = cap_drop_list if cap_drop_list
46
+ data[:cap_add] = cap_add_list unless cap_add_list.empty?
47
+ data[:cap_drop] = cap_drop_list unless cap_drop_list.empty?
48
48
  data
49
49
  end
50
50
  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.1
4
+ version: 0.8.2
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-01 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler