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 +4 -4
- data/CHANGELOG.md +7 -0
- data/examples/hello-lb-v2.yml +3 -0
- data/lib/hako/schedulers/ecs_elb_v2.rb +29 -1
- data/lib/hako/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f1cc622b196be1f0ce61dd7efa6fec85a3370ff
|
|
4
|
+
data.tar.gz: 55437297ffdc3357d1f190b092f60951090e7720
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1651fc600b1928e88209e297c256754ddc43993de868cd3a30414cc58983365b9518e21adde797940cde5404991300aeed6104cbcd49c849ae925b876091ba1
|
|
7
|
+
data.tar.gz: 8ef388bfd84c183154b98e417ad582029411a1c0d936c42185e849ab40b0ffb93edc6f5b0f6d462efc07e0c3f2928627aafa10efc67e4f25f5f8c916cac6e0e0
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
data/examples/hello-lb-v2.yml
CHANGED
|
@@ -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
|
-
|
|
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
|
data/lib/hako/version.rb
CHANGED
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.
|
|
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-
|
|
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
|