hako 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/hako.gemspec +1 -0
- data/lib/hako/schedulers/ecs.rb +29 -0
- data/lib/hako/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 455bfab68b9704f5c88024b8b7cedf62e785c0402c7319a27cc7ad211d7469e5
|
4
|
+
data.tar.gz: 8e77ee272e621bd74313efa44fe3893a7ca321f70782a79080fcc93f565b0fe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa10b71b8e5082c3349651f5497d2dd46bc67f66b88245c13e535b40c6253a68402232e9596b21133c781b31c893c4a7792139688fda4fd3af5412d051bd80f
|
7
|
+
data.tar.gz: e24e45b42ddad5852bf55696126155a6268c807fbaf079978677270c86eaa89bc4b6011907b1201e08c8285a231e9f3a91f5c11a311495054d2d1c4e5734cccb
|
data/CHANGELOG.md
CHANGED
data/hako.gemspec
CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency 'aws-sdk-elasticloadbalancingv2'
|
32
32
|
spec.add_dependency 'aws-sdk-s3'
|
33
33
|
spec.add_dependency 'aws-sdk-sns'
|
34
|
+
spec.add_dependency 'aws-sdk-ssm'
|
34
35
|
spec.add_dependency 'jsonnet'
|
35
36
|
|
36
37
|
spec.add_development_dependency 'bundler'
|
data/lib/hako/schedulers/ecs.rb
CHANGED
@@ -5,6 +5,7 @@ require 'aws-sdk-ec2'
|
|
5
5
|
require 'aws-sdk-ecs'
|
6
6
|
require 'aws-sdk-s3'
|
7
7
|
require 'aws-sdk-sns'
|
8
|
+
require 'aws-sdk-ssm'
|
8
9
|
require 'hako'
|
9
10
|
require 'hako/error'
|
10
11
|
require 'hako/scheduler'
|
@@ -104,6 +105,7 @@ module Hako
|
|
104
105
|
end
|
105
106
|
definitions.each do |d|
|
106
107
|
print_definition_in_cli_format(d)
|
108
|
+
check_secrets(d)
|
107
109
|
end
|
108
110
|
if @autoscaling
|
109
111
|
@autoscaling.apply(Aws::ECS::Types::Service.new(cluster_arn: @cluster, service_name: @app_id))
|
@@ -192,6 +194,7 @@ module Hako
|
|
192
194
|
d[:command] = commands
|
193
195
|
end
|
194
196
|
print_definition_in_cli_format(d, additional_env: env)
|
197
|
+
check_secrets(d)
|
195
198
|
end
|
196
199
|
0
|
197
200
|
else
|
@@ -337,6 +340,11 @@ module Hako
|
|
337
340
|
@ec2_client ||= Aws::EC2::Client.new(region: @region)
|
338
341
|
end
|
339
342
|
|
343
|
+
# @return [Aws::SSM::Client]
|
344
|
+
def ssm_client
|
345
|
+
@ssm_client ||= Aws::SSM::Client.new(region: @region)
|
346
|
+
end
|
347
|
+
|
340
348
|
# @return [EcsElb, EcsElbV2]
|
341
349
|
def ecs_elb_client
|
342
350
|
@ecs_elb_client ||=
|
@@ -1221,6 +1229,27 @@ module Hako
|
|
1221
1229
|
nil
|
1222
1230
|
end
|
1223
1231
|
|
1232
|
+
# @param [Hash] container_definition
|
1233
|
+
# @return [nil]
|
1234
|
+
def check_secrets(container_definition)
|
1235
|
+
parameter_names = (container_definition[:secrets] || []).map { |secret| secret.fetch(:value_from) }
|
1236
|
+
invalid_parameter_names = parameter_names.each_slice(10).flat_map do |names|
|
1237
|
+
names = names.map do |name|
|
1238
|
+
if name.start_with?('arn:')
|
1239
|
+
name.slice(%r{:parameter(/.+)\z}, 1)
|
1240
|
+
else
|
1241
|
+
name
|
1242
|
+
end
|
1243
|
+
end
|
1244
|
+
ssm_client.get_parameters(names: names).invalid_parameters
|
1245
|
+
end
|
1246
|
+
unless invalid_parameter_names.empty?
|
1247
|
+
raise Error.new("Invalid parameters for secrets: #{invalid_parameter_names}")
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
nil
|
1251
|
+
end
|
1252
|
+
|
1224
1253
|
# @param [Aws::ECS::Types::Service] service
|
1225
1254
|
# @return [nil]
|
1226
1255
|
def warn_placement_policy_change(service)
|
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: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-applicationautoscaling
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: aws-sdk-ssm
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: jsonnet
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|