knife-ec2 2.0.6 → 2.1.0

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: a5c34fa2e9535195634d8a10601644c01c708584db8dd67114a583980d6df21c
4
- data.tar.gz: 6ddb72f9b0538218edbb5293ee9ed87dfd5fe29eae1766206a9c017c26ba1c8c
3
+ metadata.gz: fe1ebf8d54dad92978109ce3af6069df518ccd163583dadff486b7492f798cf1
4
+ data.tar.gz: d8f036bc63ee4d7b30bd3656ebda5a8f4f2425b7e12b004e6603b9b909a23ae7
5
5
  SHA512:
6
- metadata.gz: 395034c7c53dbce57370882f376444a9a633e1affc953ef030a28c6d9369af8def67e800de10f32404091a480f6fb3051d7340960dedc0e1ea8fe721e5396a4c
7
- data.tar.gz: db14778ebc52428e00d1aa4e998edafa7a789e906d8fbeb5c92037178ba76c4e5799abc55cbe50388a415cc602e2980c29c00c66283bfab4f9ea18713349c660
6
+ metadata.gz: 5e5185a70b989ab3594cf73011e8c01f3cafb3449e22c64bc31012ab38d37cad35e7142e9b5070b80ad761f0fb38a623b374e26d20a25ee4ce9ef40eca7981cd
7
+ data.tar.gz: a93a5c8a752e0745c7c30dd2f42d20c718b83e21192da44a50920ed363e139d48f0bd2b36e511a17c3e8f33c8e6b7940d5ace38ff1d0426fefce0cd7a9a4369b
@@ -104,9 +104,11 @@ class Chef
104
104
  long: "--ebs-optimized",
105
105
  description: "Enabled optimized EBS I/O"
106
106
 
107
- option :ebs_no_delete_on_term,
108
- long: "--ebs-no-delete-on-term",
109
- description: "Do not delete EBS volume on instance termination"
107
+ option :ebs_delete_on_term,
108
+ long: "--ebs-delete-on-term",
109
+ description: "Delete EBS volume on instance termination",
110
+ boolean: true,
111
+ default: true
110
112
 
111
113
  option :secret,
112
114
  long: "--secret ",
@@ -624,12 +626,18 @@ class Chef
624
626
  exit 1
625
627
  end
626
628
 
627
- if config[:ebs_volume_type] && ! %w{gp2 io1 standard}.include?(config[:ebs_volume_type])
628
- ui.error("--ebs-volume-type must be 'standard' or 'io1' or 'gp2'")
629
+ if config[:ebs_volume_type] && ! %w{gp2 io1 standard st1 sc1}.include?(config[:ebs_volume_type])
630
+ ui.error("--ebs-volume-type must be 'standard' or 'io1' or 'gp2' or 'st1' or 'sc1'")
629
631
  msg opt_parser
630
632
  exit 1
631
633
  end
632
634
 
635
+ # validation for ebs_size
636
+ if (%w{st1 sc1}.include?(config[:ebs_volume_type])) && ! config[:ebs_size].to_i.between?(500, 16384)
637
+ ui.error("--ebs-size should be in between 500-16384 for 'st1' or 'sc1' ebs volume type.")
638
+ exit 1
639
+ end
640
+
633
641
  if config[:security_groups] && config[:security_groups].class == String
634
642
  ui.error("Invalid value type for knife[:security_groups] in knife configuration file (i.e knife.rb/config.rb). Type should be array. e.g - knife[:security_groups] = ['sgroup1']")
635
643
  exit 1
@@ -907,7 +915,7 @@ class Chef
907
915
  attributes[:ebs_optimized] = !!config[:ebs_optimized]
908
916
 
909
917
  if ami.root_device_type == "ebs"
910
- if config[:ebs_encrypted]
918
+ if config[:ebs_encrypted] || %w{st1 sc1}.include?(config[:ebs_volume_type])
911
919
  ami_map = ami.block_device_mappings[1]
912
920
  else
913
921
  ami_map = ami.block_device_mappings.first
@@ -924,11 +932,9 @@ class Chef
924
932
  msg opt_parser
925
933
  exit 1
926
934
  end
927
- delete_term = if config[:ebs_no_delete_on_term]
928
- "false"
929
- else
930
- ami_map.ebs.delete_on_termination if ami_map.ebs.respond_to?(:delete_on_termination)
931
- end
935
+
936
+ delete_term = config[:ebs_delete_on_term]
937
+
932
938
  iops_rate = begin
933
939
  if config[:ebs_provisioned_iops]
934
940
  Integer(config[:ebs_provisioned_iops]).to_s
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Ec2
3
- VERSION = "2.0.6".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  MAJOR, MINOR, TINY = VERSION.split(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-13 00:00:00.000000000 Z
11
+ date: 2020-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef