chef / chef/mixlib-install

artifact_info url returned is packages.chef.io versus what is set in PACKAGE_ROUTER_ENDPOINT environment variable

Open
#270 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
13
Forks
55
Avg merge
2d 15h
Merged PRs (30d)
8

Description

Version:

v3.11.2

Environment:

RHEL 5 + Chef 12.22.5

Scenario:

I am trying to use a mirror (behind corporate firewall) by using the PACKAGE_ROUTER_ENDPOINT environment variable so that artifact URLs returned are the mirror URL instead of packages.chef.io URL.

Steps to Reproduce:

$ chef exec irb
irb(main):001:0> require 'mixlib/install'
=> true
irb(main):002:0> ENV['PACKAGE_ROUTER_ENDPOINT'] = 'https://packages-mirror.domain.com'
=> "https://packages-mirror.domain.com"
irb(main):003:0> Mixlib::Install.new({:product_name=>"chef", :platform_version_compatibility_mode=>true, :platform=>"el", :platform_version=>"5", :architecture=>"x86_64", :channel=>:stable, :product_version=>'13'}).artifact_info.url
=> "https://packages-mirror.domain.com/files/stable/chef/13.12.3/el/7/chef-13.12.3-1.el7.x86_64.rpm"
irb(main):004:0> Mixlib::Install.new({:product_name=>"chef", :platform_version_compatibility_mode=>true, :platform=>"el", :platform_version=>"5", :architecture=>"x86_64", :channel=>:stable, :product_version=>'13.6.4'}).artifact_info.url
=> "https://packages.chef.io/files/stable/chef/13.12.3/el/7/chef-13.12.3-1.el7.x86_64.rpm"
irb(main):005:0> Mixlib::Install::VERSION
=> "3.11.5"

Expected Result:

I would expect that the PACKAGE_ROUTER_ENDPOINT URL would be returned by artifact_info.url regardless of the options passed.

Actual Result:

When specifying a more specific version, it returns the packages.chef.io instead of the value of PACKAGE_ROUTER_ENDPOINT

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with Mixlib::Install using PACKAGE_ROUTER_ENDPOINT, comparing artifact_info.url for a broad product version and a specific version. Start at the Mixlib::Install artifact_info URL path and trace how the endpoint is selected; done means both calls return URLs using the configured mirror, with tests covering the specific-version case.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.