diff options
author | Marc A. Paradise <marc.paradise@gmail.com> | 2021-04-20 12:05:47 -0400 |
---|---|---|
committer | Marc A. Paradise <marc.paradise@gmail.com> | 2021-04-20 12:07:08 -0400 |
commit | 0f399b5ca058c9989059e401b1beb42b013f1bc3 (patch) | |
tree | a03d00fd4cb0496ae8234af8dac6ad15e72aab8e | |
parent | 672fd930d5eafb1c38b02eabf396655b05fb0135 (diff) | |
download | chef-0f399b5ca058c9989059e401b1beb42b013f1bc3.tar.gz |
Update the download URL for windows msi
www.chef.io/chef/download has been deprecated; we should be using
omnitruck.chef.io/chef/download.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
-rw-r--r-- | knife/lib/chef/knife/core/windows_bootstrap_context.rb | 5 | ||||
-rw-r--r-- | spec/unit/knife/core/windows_bootstrap_context_spec.rb | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/knife/lib/chef/knife/core/windows_bootstrap_context.rb b/knife/lib/chef/knife/core/windows_bootstrap_context.rb index 0ff209a0b7..2904a231a5 100644 --- a/knife/lib/chef/knife/core/windows_bootstrap_context.rb +++ b/knife/lib/chef/knife/core/windows_bootstrap_context.rb @@ -294,11 +294,10 @@ class Chef "%TEMP%\\#{ChefUtils::Dist::Infra::CLIENT}-latest.msi" end - # Build a URL to query www.chef.io that will redirect to the correct - # Chef Infra msi download. + # Build a URL that will redirect to the correct Chef Infra msi download. def msi_url(machine_os = nil, machine_arch = nil, download_context = nil) if config[:msi_url].nil? || config[:msi_url].empty? - url = "https://www.chef.io/chef/download?p=windows" + url = "https://omnitruck.chef.io/chef/download?p=windows" url += "&pv=#{machine_os}" unless machine_os.nil? url += "&m=#{machine_arch}" unless machine_arch.nil? url += "&DownloadContext=#{download_context}" unless download_context.nil? diff --git a/spec/unit/knife/core/windows_bootstrap_context_spec.rb b/spec/unit/knife/core/windows_bootstrap_context_spec.rb index 1243dd1559..af656facf0 100644 --- a/spec/unit/knife/core/windows_bootstrap_context_spec.rb +++ b/spec/unit/knife/core/windows_bootstrap_context_spec.rb @@ -204,19 +204,19 @@ describe Chef::Knife::Core::WindowsBootstrapContext do end it "returns a chef.io msi url with minimal url parameters" do - reference_url = "https://www.chef.io/chef/download?p=windows&channel=stable&v=something" + reference_url = "https://omnitruck.chef.io/chef/download?p=windows&channel=stable&v=something" expect(bootstrap_context.msi_url).to eq(reference_url) end it "returns a chef.io msi url with provided url parameters substituted" do - reference_url = "https://www.chef.io/chef/download?p=windows&pv=machine&m=arch&DownloadContext=ctx&channel=stable&v=something" + reference_url = "https://omnitruck.chef.io/chef/download?p=windows&pv=machine&m=arch&DownloadContext=ctx&channel=stable&v=something" expect(bootstrap_context.msi_url("machine", "arch", "ctx")).to eq(reference_url) end context "when a channel is provided in config" do let(:config) { { channel: "current" } } it "returns a chef.io msi url with the requested channel" do - reference_url = "https://www.chef.io/chef/download?p=windows&channel=current&v=something" + reference_url = "https://omnitruck.chef.io/chef/download?p=windows&channel=current&v=something" expect(bootstrap_context.msi_url).to eq(reference_url) end end |