stemcell 0.13.1 → 0.13.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9942211d9334ce09b4a56299f2bc7e3e903d57eb871a60a8a1228c549e6b1407
4
- data.tar.gz: 3e70bbdc1434124922c4be3cfb29e6842d6cda8210a1555fe3c36e4887740a11
3
+ metadata.gz: 440002a8d4c58fd1329664656e61589e6d174e7330acfa73af957e8d2e690d7c
4
+ data.tar.gz: 88a3fe213bfc823772d72296a130b37fca10032c8519597277d377e1abdfd798
5
5
  SHA512:
6
- metadata.gz: c4f0a32c8fe858b23bd3ddbbb30ca752a0b23c0a2782d9fd0cf56d9cda0e344bdaa3c2361b1df9f4d5f5413ca88e15c714c868ee2efaa1b304dd74d248601fdb
7
- data.tar.gz: a9fb4751d0fe25b94f4c47785da168a9e0e909464d0354461adc8db5d01487d5ea696ebcbc79e74267b6ccd114a794a5e5d13ed90bd6b831a20c3bb5ae5b4906
6
+ metadata.gz: 80f1c8e2e9f3fee310ff779dfcb9b1b4e7118ed27da2045441747b0783060fb9dc39022a6c23740167f76c9d4655999015a6858d68cdc2c906c73bfb2af99d4e
7
+ data.tar.gz: 07ba99d048effdccd90f9a1185449e13e9829cb047d2c16c027c91834accd2610b053b460bc0f5eba8983ca49312a3238d817d9d5946cd81bd57ff4ce021f4b3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.13.1
2
+ - Support for specifying --min-count and --max-count
3
+
1
4
  # 0.13.1
2
5
  - Support for specifying --cpu-options
3
6
 
@@ -47,6 +47,8 @@ module Stemcell
47
47
  'dedicated_tenancy',
48
48
  'associate_public_ip_address',
49
49
  'count',
50
+ 'min_count',
51
+ 'max_count',
50
52
  'security_groups',
51
53
  'security_group_ids',
52
54
  'tags',
@@ -102,16 +104,19 @@ module Stemcell
102
104
  tags['Name'] = opts['chef_role'] if opts['chef_environment'] == 'production'
103
105
  tags.merge!(opts['tags']) if opts['tags']
104
106
 
107
+ # Min/max number of instances to launch
108
+ min_count = opts['min_count'] || opts['count']
109
+ max_count = opts['max_count'] || opts['count']
110
+
105
111
  # generate launch options
106
112
  launch_options = {
107
113
  :image_id => opts['image_id'],
108
114
  :instance_type => opts['instance_type'],
109
115
  :key_name => opts['key_name'],
110
- :min_count => opts['count'],
111
- :max_count => opts['count'],
116
+ :min_count => min_count,
117
+ :max_count => max_count,
112
118
  }
113
119
 
114
-
115
120
  # Associate Public IP can only bet set on network_interfaces, and if present
116
121
  # security groups and subnet should be set on the interface. VPC-only.
117
122
  # Primary network interface
@@ -259,6 +259,18 @@ module Stemcell
259
259
  :type => Integer,
260
260
  :env => 'COUNT'
261
261
  },
262
+ {
263
+ :name => 'min_count',
264
+ :desc => "minimum number of instances to launch",
265
+ :type => Integer,
266
+ :env => 'MIN_COUNT'
267
+ },
268
+ {
269
+ :name => 'max_count',
270
+ :desc => "maximum number of instances to launch",
271
+ :type => Integer,
272
+ :env => 'MAX_COUNT'
273
+ },
262
274
  {
263
275
  :name => 'tail',
264
276
  :desc => "interactively tail the initial converge",
@@ -1,3 +1,3 @@
1
1
  module Stemcell
2
- VERSION = "0.13.1"
2
+ VERSION = "0.13.2"
3
3
  end
@@ -114,6 +114,19 @@ describe Stemcell::Launcher do
114
114
  launched_instances = launcher.send(:launch, launch_options)
115
115
  expect(launched_instances.map(&:public_ip_address)).to all(be_truthy)
116
116
  end
117
+
118
+ it 'launches with min/max count' do
119
+ expect(launcher).to receive(:do_launch).with(a_hash_including(
120
+ :min_count => 3,
121
+ :max_count => 6,
122
+ )).and_return(instances)
123
+ options = launch_options.merge(
124
+ 'min_count' => 3,
125
+ 'max_count' => 6,
126
+ )
127
+ launched_instances = launcher.send(:launch,
128
+ launch_options.merge('min_count' => 3, 'max_count' => 6))
129
+ end
117
130
  end
118
131
 
119
132
  describe '#kill' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stemcell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Rhoads
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-01-05 00:00:00.000000000 Z
14
+ date: 2022-02-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: aws-eventstream
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubygems_version: 3.0.3
270
+ rubygems_version: 3.0.3.1
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: no summary