kitchen-vagrant 1.14.2 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 773e721e0d0a6a5b247a81564963e6dc54c29239610ab984f978d2d11a647d01
4
- data.tar.gz: 66eb6a6c254227c89c96004ff0a1c4d39b3eb7404a5d945bf51558d3cdc2d0f8
3
+ metadata.gz: a3f214228bf52efa9cb0d163b283d714f61426e13d6ca0b37d0632201f48bd94
4
+ data.tar.gz: 8ae44fd2027215c4c5e507a1f744cacd91ced18e82072717857b29e659a4f880
5
5
  SHA512:
6
- metadata.gz: 0c62f0582d48f45b0c8df5b7bd0e4d33722ca14e685e4da0a09ea350ec4f1c1c13ca26635d18045533f509ef996cea07cd37af3accd23ebc3a0a9b02e15cb98b
7
- data.tar.gz: 6af826384d3f17bc56f728d50fa26d6b1b208b9327af849175254f72ff05262a05ba1baa1578fca01467a1fc2ef45cc293866b7ab70d9d72cc737bc8eb9a942c
6
+ metadata.gz: 630ab055d4e77582c79661484a731a772e9b18a1afa73ba52c7eddbb80744a0df6905dc2aaa2746fda9c3bae666a29dbc9c172502f70f27946c038a3822a21bb
7
+ data.tar.gz: d3c5734ad3be9c51a811d753edc99daca20ce8af8d60884f4cb24c7b463b7083246a0b3c640fc6de52dbc339ec49952de500a426d285ec559996f64ee88a69d3
@@ -56,6 +56,8 @@ module Kitchen
56
56
 
57
57
  default_config :box_version, nil
58
58
 
59
+ default_config :box_arch, nil
60
+
59
61
  default_config :boot_timeout, nil
60
62
 
61
63
  default_config :customize, {}
@@ -125,7 +127,7 @@ module Kitchen
125
127
  # @return [String,nil] the Vagrant box for this Instance
126
128
  def default_box
127
129
  if bento_box?(instance.platform.name)
128
- "bento/#{instance.platform.name}#{"-arm64" if RbConfig::CONFIG["host_cpu"].eql?("arm64")}"
130
+ "bento/#{instance.platform.name}"
129
131
  else
130
132
  instance.platform.name
131
133
  end
@@ -224,16 +226,10 @@ module Kitchen
224
226
 
225
227
  protected
226
228
 
227
- WEBSITE = "https://www.vagrantup.com/downloads.html".freeze
228
- MIN_VER = "1.1.0".freeze
229
+ WEBSITE = "https://developer.hashicorp.com/vagrant/install".freeze
230
+ MIN_VER = "2.4.0".freeze
229
231
 
230
232
  class << self
231
-
232
- # @return [true,false] whether or not the vagrant-winrm plugin is
233
- # installed
234
- # @api private
235
- attr_accessor :winrm_plugin_passed
236
-
237
233
  # @return [String] the version of Vagrant installed on the workstation
238
234
  # @api private
239
235
  attr_accessor :vagrant_version
@@ -313,14 +309,20 @@ module Kitchen
313
309
  def finalize_box_auto_update!
314
310
  return if config[:box_auto_update].nil?
315
311
 
316
- config[:box_auto_update] = "vagrant box update #{"--insecure " if config[:box_download_insecure]}--box #{config[:box]} --provider #{config[:provider]}"
312
+ cmd = "#{config[:vagrant_binary]} box update --box #{config[:box]}"
313
+ cmd += " --architecture #{config[:box_arch]}" if config[:box_arch]
314
+ cmd += " --provider #{config[:provider]}" if config[:provider]
315
+ cmd += " --insecure" if config[:box_download_insecure]
316
+ config[:box_auto_update] = cmd
317
317
  end
318
318
 
319
319
  # Create vagrant command to remove older versions of the box
320
320
  def finalize_box_auto_prune!
321
321
  return if config[:box_auto_prune].nil?
322
322
 
323
- config[:box_auto_prune] = "vagrant box prune --force --keep-active-boxes --name #{config[:box]} --provider #{config[:provider]}"
323
+ cmd = "#{config[:vagrant_binary]} box prune --force --keep-active-boxes --name #{config[:box]}"
324
+ cmd += " --provider #{config[:provider]}" if config[:provider]
325
+ config[:box_auto_prune] = cmd
324
326
  end
325
327
 
326
328
  # Replaces any `{{vagrant_root}}` tokens in the pre create command.
@@ -390,19 +392,6 @@ module Kitchen
390
392
  end
391
393
  end
392
394
 
393
- # Loads any required third party Ruby libraries or runs any shell out
394
- # commands to prepare the plugin. This method will be called in the
395
- # context of the main thread of execution and so does not necessarily
396
- # have to be thread safe.
397
- #
398
- # @raise [ClientError] if any library loading fails or any of the
399
- # dependency requirements cannot be satisfied
400
- # @api private
401
- def load_needed_dependencies!
402
- super
403
- verify_winrm_plugin if winrm_transport?
404
- end
405
-
406
395
  # Renders the Vagrantfile ERb template.
407
396
  #
408
397
  # @return [String] the contents for a Vagrantfile
@@ -597,46 +586,12 @@ module Kitchen
597
586
  " Please download a package from #{WEBSITE}."
598
587
  end
599
588
 
600
- # Verify that the vagrant-winrm plugin is installed and a suitable
601
- # version of Vagrant is installed
602
- #
603
- # @api private
604
- def verify_winrm_plugin
605
- if Gem::Version.new(vagrant_version) < Gem::Version.new("1.6")
606
- raise UserError, "Detected an old version of Vagrant " \
607
- "(#{vagrant_version}) that cannot support the vagrant-winrm " \
608
- "Vagrant plugin." \
609
- " Please upgrade to version 1.6 or higher from #{WEBSITE}."
610
- end
611
-
612
- if Gem::Version.new(vagrant_version) < Gem::Version.new("2.2.0") && !winrm_plugin_installed?
613
- raise UserError, "Vagrant version #{vagrant_version} requires the " \
614
- "vagrant-winrm plugin to properly communicate with this Vagrant VM " \
615
- "over WinRM Transport. Please install this plugin with: " \
616
- "`vagrant plugin install vagrant-winrm' and try again." \
617
- "Alternatively upgrade to Vagrant >= 2.2.0 which does not " \
618
- "require the vagrant-winrm plugin."
619
- end
620
- end
621
-
622
589
  # @return [true,false] whether or not the host is windows
623
590
  #
624
591
  # @api private
625
592
  def windows_host?
626
593
  RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
627
594
  end
628
-
629
- # @return [true,false] whether or not the vagrant-winrm plugin is
630
- # installed
631
- # @api private
632
- def winrm_plugin_installed?
633
- return true if self.class.winrm_plugin_passed
634
-
635
- self.class.winrm_plugin_passed = run_silently(
636
- "#{config[:vagrant_binary]} plugin list", cwd: Dir.pwd
637
- )
638
- .split("\n").find { |line| line =~ /vagrant-winrm\s+/ }
639
- end
640
595
  end
641
596
  end
642
597
  end
@@ -20,6 +20,6 @@ module Kitchen
20
20
  module Driver
21
21
 
22
22
  # Version string for Vagrant Kitchen driver
23
- VAGRANT_VERSION = "1.14.2".freeze
23
+ VAGRANT_VERSION = "2.0.0".freeze
24
24
  end
25
25
  end
@@ -20,6 +20,10 @@ Vagrant.configure("2") do |c|
20
20
  c.vm.box_version = "<%= config[:box_version] %>"
21
21
  <% end %>
22
22
 
23
+ <% if config[:box_arch] %>
24
+ c.vm.box_architecture = "<%= config[:box_arch] %>"
25
+ <% end %>
26
+
23
27
  <% if !config[:box_check_update].nil? %>
24
28
  c.vm.box_check_update = <%= config[:box_check_update] %>
25
29
  <% end %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-27 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -30,7 +30,7 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4'
33
- description: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
33
+ description: Kitchen::Driver::Vagrant - A HashiCorp Vagrant Driver for Test Kitchen.
34
34
  email:
35
35
  - fnichol@nichol.ca
36
36
  executables: []
@@ -55,15 +55,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: '2.7'
58
+ version: '3.0'
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.4.10
65
+ rubygems_version: 3.5.4
66
66
  signing_key:
67
67
  specification_version: 4
68
- summary: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
68
+ summary: Kitchen::Driver::Vagrant - A HashiCorp Vagrant Driver for Test Kitchen.
69
69
  test_files: []