summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-04-20 09:50:27 -0700
committerGitHub <noreply@github.com>2021-04-20 09:50:27 -0700
commit42e4bc3063296c7dfe83ac1b4f43f5aef8e418b4 (patch)
tree76c7547b30d2cb9b109da3893c0806996db4a8a7
parentb479ae3c25821e36a95e4a225a785be6aa7c54c8 (diff)
parente87679c3ad088a4587239ddc1e1d2ff0c82b3e4c (diff)
downloadchef-42e4bc3063296c7dfe83ac1b4f43f5aef8e418b4.tar.gz
Merge pull request #11401 from chef/mp/fix-windows-bootstrap-msi-url-16
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/knife/core/windows_bootstrap_context.rb5
-rw-r--r--spec/unit/knife/core/windows_bootstrap_context_spec.rb6
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/chef/knife/core/windows_bootstrap_context.rb b/lib/chef/knife/core/windows_bootstrap_context.rb
index fa8b43f383..95a6eed1e8 100644
--- a/lib/chef/knife/core/windows_bootstrap_context.rb
+++ b/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 76b90c955e..706e110718 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