hako 1.8.1 → 1.8.2

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: 8c72d876a8523117cb28e9b64938792732d01991
4
- data.tar.gz: 49c8f8baab9ce2b173296c79d6327cee0abfca16
3
+ metadata.gz: 5f1cc622b196be1f0ce61dd7efa6fec85a3370ff
4
+ data.tar.gz: 55437297ffdc3357d1f190b092f60951090e7720
5
5
  SHA512:
6
- metadata.gz: 03605a8ac2a59471ecf74c9f08f06fc62c84c3188adac5804d3b7001d742619dd1c0379a230f3fc1aa98b37238b6ff6cb788efe16a56f78b83384d0a2885a1af
7
- data.tar.gz: eb370ef4164435c9f580080106f2af47ca2b5d93aad987dedf027a53e55995ede062a54dff8181a1fcba8216a94e0283d5f3a927d58d5ae640c9c7648639569f
6
+ metadata.gz: c1651fc600b1928e88209e297c256754ddc43993de868cd3a30414cc58983365b9518e21adde797940cde5404991300aeed6104cbcd49c849ae925b876091ba1
7
+ data.tar.gz: 8ef388bfd84c183154b98e417ad582029411a1c0d936c42185e849ab40b0ffb93edc6f5b0f6d462efc07e0c3f2928627aafa10efc67e4f25f5f8c916cac6e0e0
@@ -1,3 +1,10 @@
1
+ # 1.8.2 (2017-09-15)
2
+ ## Bug fixes
3
+ - Retry DeleteTargetGroup in `hako remove`
4
+ - Deleting a load balancer may take several seconds
5
+ ## Improvements
6
+ - Add target_group_attributes option to elb_v2
7
+
1
8
  # 1.8.1 (2017-09-15)
2
9
  ## Improvements
3
10
  - Add container_name and container_port option to elb and elb_v2
@@ -26,6 +26,9 @@ scheduler:
26
26
  access_logs.s3.enabled: 'true'
27
27
  access_logs.s3.bucket: hako-access-logs
28
28
  access_logs.s3.prefix: hako-hello-lb-v2
29
+ target_group_attributes:
30
+ deregistration_delay.timeout_seconds: '20'
31
+ # http://docs.aws.amazon.com/en_us/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-attributes
29
32
  app:
30
33
  image: ryotarai/hello-sinatra
31
34
  memory: 128
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'aws-sdk-elasticloadbalancingv2'
4
4
  require 'hako'
5
+ require 'hako/error'
5
6
 
6
7
  module Hako
7
8
  module Schedulers
@@ -116,6 +117,20 @@ module Hako
116
117
  elb_client.modify_load_balancer_attributes(load_balancer_arn: load_balancer.load_balancer_arn, attributes: attributes)
117
118
  end
118
119
  end
120
+ if @elb_v2_config.key?('target_group_attributes')
121
+ target_group = describe_target_group
122
+ attributes = @elb_v2_config.fetch('target_group_attributes').map { |key, value| { key: key, value: value } }
123
+ if @dry_run
124
+ if target_group
125
+ Hako.logger.info("elb_client.modify_target_group_attributes(target_group_arn: #{target_group.target_group_arn}, attributes: #{attributes.inspect}) (dry-run)")
126
+ else
127
+ Hako.logger.info("elb_client.modify_target_group_attributes(target_group_arn: unknown, attributes: #{attributes.inspect}) (dry-run)")
128
+ end
129
+ else
130
+ Hako.logger.info("Updating target group attributes to #{attributes.inspect}")
131
+ elb_client.modify_target_group_attributes(target_group_arn: target_group.target_group_arn, attributes: attributes)
132
+ end
133
+ end
119
134
  nil
120
135
  end
121
136
 
@@ -142,7 +157,20 @@ module Hako
142
157
  if @dry_run
143
158
  Hako.logger.info("elb_client.delete_target_group(target_group_arn: #{target_group.target_group_arn})")
144
159
  else
145
- elb_client.delete_target_group(target_group_arn: target_group.target_group_arn)
160
+ deleted = false
161
+ 30.times do
162
+ begin
163
+ elb_client.delete_target_group(target_group_arn: target_group.target_group_arn)
164
+ deleted = true
165
+ break
166
+ rescue Aws::ElasticLoadBalancingV2::Errors::ResourceInUse => e
167
+ Hako.logger.warn("#{e.class}: #{e.message}")
168
+ end
169
+ sleep 1
170
+ end
171
+ unless deleted
172
+ raise Error.new("Cannot delete target group #{target_group.target_group_arn}")
173
+ end
146
174
  Hako.logger.info "Deleted target group #{target_group.target_group_arn}"
147
175
  end
148
176
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hako
4
- VERSION = '1.8.1'
4
+ VERSION = '1.8.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2017-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-applicationautoscaling