ecs_deploy 1.0.6 → 1.0.7

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
  SHA256:
3
- metadata.gz: c835fe6c187c1e2558ba6de3c957bb41f3eafde5804b79fd611864f0ef32aa31
4
- data.tar.gz: 47b1b66e32e8a246bd97658f85b473f5c07942d73e4bc932685a8fbe7386fd4a
3
+ metadata.gz: 932b0b421b5a352c6f5fd2a3f110baf393c6d0667fa951abfeeb97a0badbe074
4
+ data.tar.gz: 53ddcbcea0662a0e154192be3e71c5161309ba042146e81f9a5f29794e25988f
5
5
  SHA512:
6
- metadata.gz: e599e6a06c67bf78dc17a6b746ba680e8043440dda0870595bd2aa36cb08b6357eb3350c88875897510327fa261fb45cdbd7ff237f0cd5c52a1d6021f910d9fb
7
- data.tar.gz: f65b908df4382062dec6ba228d1714df5f2b64a516c42450482767ebf48c52345a3d72db465c57fd6058f4082d6b07b2569ce18b369337a2eb71f2ffe9121769
6
+ metadata.gz: 88a77e68a9ef43fe818fe529af5f75b1dfaa4b9ccf0505fabe1c185f67eb051f041b6720239bda895fd812125aa960728585aff85f149b99a30331e16c47cef7
7
+ data.tar.gz: 4dd7312beb91fc54635d79e44b8795c00866085d3b117f8583fb5c082970dc521fd53423ef3aa5c2c942d5adf6656296034b1952cb32e5b55087d8102173e79e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # v1.0
2
2
 
3
+ ## Release v1.0.7 - 2024/08/08
4
+
5
+ ### Bug fixes
6
+
7
+ - Fix Aws::AutoScaling::Errors::ValidationError https://github.com/reproio/ecs_deploy/pull/85
8
+
3
9
  ## Release v1.0.6 - 2024/03/19
4
10
 
5
11
  ### Enhancement
@@ -63,10 +63,14 @@ module EcsDeploy
63
63
  )
64
64
  end
65
65
 
66
+ # NOTE: InstanceDrainer calls this method when it receives spot instance interruption warnings
66
67
  def detach_instances(instance_ids:, should_decrement_desired_capacity:)
67
68
  return if instance_ids.empty?
68
69
 
69
- instance_ids.each_slice(MAX_DETACHABLE_INSTANCE_COUNT) do |ids|
70
+ # detach only detachable instances
71
+ detachable_instance_ids = instance_ids & describe_detachable_instances.map(&:instance_id)
72
+
73
+ detachable_instance_ids.each_slice(MAX_DETACHABLE_INSTANCE_COUNT) do |ids|
70
74
  client.detach_instances(
71
75
  auto_scaling_group_name: name,
72
76
  instance_ids: ids,
@@ -181,7 +185,9 @@ module EcsDeploy
181
185
  client.describe_auto_scaling_groups({ auto_scaling_group_names: [name] }).auto_scaling_groups[0].instances.reject do |i|
182
186
  # The lifecycle state of terminated instances becomes "Detaching", "Terminating", "Terminating:Wait", or "Terminating:Proceed",
183
187
  # and we can't detach instances in such a state.
184
- i.lifecycle_state.start_with?("Terminating") || i.lifecycle_state == "Detaching"
188
+ i.lifecycle_state.start_with?("Terminating") || i.lifecycle_state == "Detaching" ||
189
+ # EC2 instance sometimes stays in Pending state for more than 10 minutes
190
+ i.lifecycle_state == "Pending"
185
191
  end
186
192
  end
187
193
 
@@ -1,3 +1,3 @@
1
1
  module EcsDeploy
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-21 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-autoscaling