hako 0.11.0 → 0.11.1

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: d38174e02789d9c6483172755239f8533b8be58a
4
- data.tar.gz: 412c52142395ca4e316bea3149d8e643de6f9802
3
+ metadata.gz: f4f272b12fda08e6fef5e8f28413f35320747a70
4
+ data.tar.gz: e632e91834a590ec1e22e3a656d2e18d182e2639
5
5
  SHA512:
6
- metadata.gz: 14a30482ccd6a222fb278191ef74269491f7846d0151e82e9083451e8a87c8a73c5791f35472cebc2787ce66279aa018fcbab6667c0f4a8a4f89e7a82d2e6504
7
- data.tar.gz: 3cac7854f49ef7989b284f14c5c1cdc96e1181cd2e003419f2557886ec96021b0e002d404b78d38d2511c00a8c52592cc30b5009c8db5d4aec2c730101d90453
6
+ metadata.gz: 2e0bae90082a189252c38c9840791d8fbea6acf1efc6559ebc8b213ce8618f6bef42a290a5b30968b825691407619d9950efff0fcfe0897ef0755c672203a52b
7
+ data.tar.gz: c5e09e51d46695484ef68ad02504f8a4ec0f1879c74b289b6b85f40a145f1638f0dc32b8fa9c68f6c71347c70b37232f2b7d79f17e197548acf9b1aaf6e037f6
@@ -18,7 +18,6 @@ module Hako
18
18
  cpu
19
19
  memory
20
20
  links
21
- mount_points
22
21
  ].each do |name|
23
22
  define_method(name) do
24
23
  @definition[name]
@@ -33,6 +32,16 @@ module Hako
33
32
  @expanded_env ||= expand_env(@definition.fetch('env', {}))
34
33
  end
35
34
 
35
+ def mount_points
36
+ @definition['mount_points'].map do |mount_point|
37
+ {
38
+ source_volume: mount_point.fetch('source_volume'),
39
+ container_path: mount_point.fetch('container_path'),
40
+ read_only: mount_point.fetch('read_only', false),
41
+ }
42
+ end
43
+ end
44
+
36
45
  private
37
46
 
38
47
  PROVIDERS_KEY = '$providers'
@@ -6,9 +6,10 @@ module Hako
6
6
  @expected_container = expected_container
7
7
  end
8
8
 
9
- CONTAINER_KEYS = %i[image cpu memory links docker_labels mount_points].freeze
9
+ CONTAINER_KEYS = %i[image cpu memory links docker_labels].freeze
10
10
  PORT_MAPPING_KEYS = %i[container_port host_port protocol].freeze
11
11
  ENVIRONMENT_KEYS = %i[name value].freeze
12
+ MOUNT_POINT_KEYS = %i[source_volume container_path read_only].freeze
12
13
 
13
14
  def different?(actual_container)
14
15
  unless actual_container
@@ -34,6 +35,15 @@ module Hako
34
35
  end
35
36
  end
36
37
 
38
+ if @expected_container[:mount_points].size != actual_container.mount_points.size
39
+ return true
40
+ end
41
+ @expected_container[:mount_points].zip(actual_container.mount_points) do |e, a|
42
+ if different_members?(e, a, MOUNT_POINT_KEYS)
43
+ return true
44
+ end
45
+ end
46
+
37
47
  false
38
48
  end
39
49
 
data/lib/hako/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hako
3
- VERSION = '0.11.0'
3
+ VERSION = '0.11.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki