terradactyl-terraform 1.8.0 → 1.8.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: 4b36a7e64011be5115b310c46c7dd57e287983288f45688fb2633654340a1fdc
4
- data.tar.gz: 01cdafbbfe6a4025e03bd05f57cfa6d1458cd0d2deeb4126a410ebf3b4ce02bc
3
+ metadata.gz: a2dfea5ec6c90e0702ac97ab7ded539f25449f5a740cfab11e9bebc8585abb7d
4
+ data.tar.gz: 5db7c1cd55112ec8c641dc46f12d29bbd05d3e3b210e445971feb899767f1558
5
5
  SHA512:
6
- metadata.gz: 439d0d72510c36d950305dc08d794b926308f9c5faef045af116c31dd669be6cc32e8a52a528f354efce03a4418ebf10d59bccfe32bc39b826f29c6e10d537eb
7
- data.tar.gz: '086410255b2ee3ce7bb778e068e9ee2ca24e24b6c44c9a8bf72070d5fa051dc4d142ed0cb7446da650aabd582a547c51211890f7a7eb11c2684796a151778e0b'
6
+ metadata.gz: 4bc83ac367c5cec84be36508d98aef747699cf3eaa4e29bd0dbd4e56a64e8d9d8b57140c4f7d93e4533c59013fd81f595b3d960fc5e5f92ab586c6b96ccc194f
7
+ data.tar.gz: e25af71ba8475ea1ac53f876a67c8d9cf0ff57c72b4a5fb058b6830003069c6e95764a6db79252830ca23e212ba540a306701c47fec5213508a65f826f52361c
data/CHANGELOG.md CHANGED
@@ -1,16 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 1.8.0 (2025-04-10)
3
+ ## 1.8.2 (2024-04-24)
4
+ BUG FIX:
5
+ * fix unzipping TF versions > 1.8.2 (breaking distribution change [details](https://github.com/hashicorp/terraform/blob/v1.8.2/CHANGELOG.md#182-april-24-2024))
6
+
7
+ ## 1.8.1 (2024-04-17)
8
+ NEW FEATURES:
9
+ * add support for using latest Terraform 1.x minor version without an explicit implementation
10
+ * update init, planfile, and destroy commands (add Rev1_latest)
11
+
12
+ BUG FIX:
13
+ * fix downloading TF versions < 1.0 on `arm64` architectures
14
+
15
+ ## 1.8.0 (2024-04-10)
16
+ NEW FEATURES:
4
17
  * add support for Terraform version `~> 1.8.0`
5
18
  * update init, planfile, and destroy commands (add Rev1_08)
6
19
  * add Rev1_08 rspecs
7
20
 
8
21
  ## 1.7.0 (2024-01-17)
22
+ NEW FEATURES:
9
23
  * add support for Terraform version `~> 1.7.0`
10
24
  * update init, planfile, and destroy commands (add Rev1_07)
11
25
  * add Rev1_07 rspecs
12
26
 
13
27
  ## 1.6.0 (2023-10-04)
28
+ NEW FEATURES:
14
29
  * add support for Terraform version `~> 1.6.0`
15
30
  * update init, planfile, and destroy commands (add Rev1_06)
16
31
  * add Rev1_06 rspecs
@@ -6,7 +6,7 @@ module Terradactyl
6
6
  def calc_revision(version)
7
7
  major, minor = version.split(/\.|-/).take(2)
8
8
  major = major.to_i.zero? ? major : major + '_'
9
- minor = minor.rjust(2, '0') # pad a single digit
9
+ minor = minor.nil? ? 'latest' : minor.rjust(2, '0') # pad a single digit unless not provided
10
10
  ['Rev', major, minor].join
11
11
  end
12
12
 
@@ -104,6 +104,12 @@ module Terradactyl
104
104
  end
105
105
  end
106
106
 
107
+ module Rev1_latest
108
+ module Destroy
109
+ include Terradactyl::Terraform::Rev015::Destroy
110
+ end
111
+ end
112
+
107
113
  module Commands
108
114
  class Destroy < Base
109
115
  end
@@ -101,6 +101,12 @@ module Terradactyl
101
101
  end
102
102
  end
103
103
 
104
+ module Rev1_latest
105
+ module Init
106
+ include Terradactyl::Terraform::Rev015::Init
107
+ end
108
+ end
109
+
104
110
  module Commands
105
111
  class Init < Base
106
112
  end
@@ -148,6 +148,11 @@ module Terradactyl
148
148
  end
149
149
  end
150
150
 
151
+ module Rev1_latest
152
+ class PlanFileParser < Rev012::PlanFileParser
153
+ end
154
+ end
155
+
151
156
  module Rev011
152
157
  class PlanFileParser < Rev012::PlanFileParser
153
158
  def checksum
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Terradactyl
4
4
  module Terraform
5
- VERSION = '1.8.0'
5
+ VERSION = '1.8.2'
6
6
  end
7
7
  end
@@ -7,6 +7,7 @@ module Terradactyl
7
7
  include Package
8
8
 
9
9
  ERROR_CHECKSUM = 'FATAL: Calculated sum does not match published value!'
10
+ TERRAFORM_FILENAME = 'terraform'
10
11
 
11
12
  attr_accessor :version
12
13
 
@@ -52,7 +53,11 @@ module Terradactyl
52
53
  private
53
54
 
54
55
  def unzip(src, dst)
55
- Zip::File.open(src) { |arch| arch.each { |f| f.extract(dst) } }
56
+ Zip::File.open(src) do |arch|
57
+ arch.each do |f|
58
+ f.extract(dst) if f.name.include?(TERRAFORM_FILENAME)
59
+ end
60
+ end
56
61
  end
57
62
 
58
63
  def fetch
@@ -81,7 +86,7 @@ module Terradactyl
81
86
  end
82
87
 
83
88
  def archive_file
84
- "terraform_#{version}_#{platform}_#{architecture}.zip"
89
+ "terraform_#{version}_#{platform}_#{architecture(version)}.zip"
85
90
  end
86
91
 
87
92
  def download_url
@@ -16,8 +16,12 @@ module Terradactyl
16
16
  end
17
17
 
18
18
  def fetch(url: self.url)
19
- @fh = URI.parse(url).open
20
- @path = @fh.path
19
+ begin
20
+ @fh = URI.parse(url).open
21
+ @path = @fh.path
22
+ rescue OpenURI::HTTPError => e
23
+ puts "Can't access #{url}", e.message
24
+ end
21
25
  @fh
22
26
  end
23
27
 
@@ -4,7 +4,7 @@ module Terradactyl
4
4
  module Terraform
5
5
  module VersionManager
6
6
  module Package
7
- def architecture
7
+ def architecture(version = nil)
8
8
  case value = RbConfig::CONFIG['host_cpu'].downcase
9
9
  when /amd64|x86_64/
10
10
  'amd64'
@@ -13,7 +13,11 @@ module Terradactyl
13
13
  when /^arm$/
14
14
  'arm'
15
15
  when /^arm64|aarch64/
16
- 'arm64'
16
+ if !version.nil? && version.start_with?('0.')
17
+ 'amd64' # fall back to amd64 because no arm64 releases for TF versions < 1.0
18
+ else
19
+ 'arm64'
20
+ end
17
21
  else
18
22
  raise "FATAL: Unsupported CPU arch, #{value}"
19
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terradactyl-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Warsing
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-10 00:00:00.000000000 Z
11
+ date: 2024-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip