Skip to content

Commit df215db

Browse files
Update box add action to pass arch correctly (#13699)
Currently, during the box add action env[:architecture] gets passed down to add_direct, however, there is no architecture in env, the correct arch which is set in Vagrantfile is box_architecture, this PR changes the action to pass down the correct parameter. Closes: #13698, #13697
1 parent 4647038 commit df215db

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/vagrant/action/builtin/box_add.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def add_direct(urls, env)
192192
env,
193193
checksum: env[:box_checksum],
194194
checksum_type: env[:box_checksum_type],
195-
architecture: env[:architecture]
195+
architecture: env[:box_architecture]
196196
)
197197
end
198198

test/unit/vagrant/action/builtin/box_add_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ def with_web_server(path, **opts)
114114

115115
env[:box_name] = "foo"
116116
env[:box_url] = box_path.to_s
117+
env[:box_architecture] = "x86_64"
117118

118119
expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts|
119120
expect(checksum(path)).to eq(checksum(box_path))
120121
expect(name).to eq("foo")
121122
expect(version).to eq("0")
123+
expect(opts[:architecture]).to eq("x86_64")
122124
expect(opts[:metadata_url]).to be_nil
123125
true
124126
}.and_return(box)

0 commit comments

Comments
 (0)