Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mixlib-install to allow other products #339

Open
Tensibai opened this issue Dec 23, 2020 · 4 comments
Open

Improve mixlib-install to allow other products #339

Tensibai opened this issue Dec 23, 2020 · 4 comments
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@Tensibai
Copy link
Contributor

Describe the Enhancement:

Actually I need two endpoints, one using Chef's mixlib-install and one overriding the mixlib-isntall with cinc project's one.

Improving mixlib-install to take an extra file to allow other products with their api url would avoid that.

Describe the Need:

I'd wish to have an internal omnitruck endpoint allowing me to install chef or cinc.

Current Alternative

Monkey patching mixlib-install options like this:

module Mixlib
  class Install
    class Options 
      SUPPORTED_PRODUCT_NAMES += %w(cinc auditor cinc-server)

      def initialize(options)
        @options = options
        @errors = []
        
        PRODUCT_MATRIX.product "auditor" do
          product_name "Cinc Auditor"
          package_name "auditor"
          downloads_product_page_url :not_available
        end

        PRODUCT_MATRIX.product "cinc" do
          product_name "Cinc client"
          package_name "cinc"
          downloads_product_page_url :not_available
        end

        PRODUCT_MATRIX.product "cinc" do
          product_name "Cinc client"
          package_name "cinc"
          downloads_product_page_url :not_available
        end
        ENV['PACKAGE_ROUTER_ENDPOINT'] =  ENV.fetch('PACKAGE_ROUTER_ENDPOINT', 'http://packages.cinc.sh') if %w(cinc auditor cinc-server).include? options[:product_name] 
        # Store original options in cases where we must remap
        @original_platform_version = options[:platform_version]

        resolve_platform_version_compatibility_mode!

        map_windows_versions!

        validate!
      
      end
    end
  end
end

Can We Help You Implement This?:

Merge request incoming :)

@rjhornsby
Copy link

rjhornsby commented Jun 17, 2022

edit: PR already created, linked above. I missed it.

It looks as though support for cinc was added to the chef_client_updater cookbook, but that cookbook is failing because its dependency on this library, which does not list cinc in the product matrix. The cookbook correctly installs mixlib-install-3.12.19, but fails with this message when the client version is changed (ie for an upgrade):

Generated at 2022-06-17 17:01:54 +0000
Mixlib::Install::Options::InvalidOptions: chef_client_updater[cinc_install_17.10.0] (sev1_cinc_client::install line 1) had an error: Mixlib::Install::Options::InvalidOptions: Unknown product name cinc.
Must be one of: analytics, angry-omnibus-toolchain, angrychef, automate, chef, chef-backend, chef-server, chef-server-ha-provisioning, chef-workstation, chefdk, compliance, delivery, ha, harmony, inspec, mac-bootstrapper, manage, marketplace, omnibus-toolchain, omnibus-gcc, private-chef, push-jobs-client, push-jobs-server, reporting, supermarket, sync

C:/cinc-project/cinc/embedded/lib/ruby/gems/3.0.0/gems/mixlib-install-3.12.19/lib/mixlib/install/options.rb:105:in `validate_options!'
...

@Heatcliff199
Copy link

Heatcliff199 commented Nov 15, 2022

Can you tell me if there is any information about the bug? Because when I try to specify the cinc package in the attributes, an error pops up
Mixlib::Install::Options::InvalidOptions
----------------------------------------
Unknown product name cinc.
Must be one of: analytics, angry-omnibus-toolchain, angrychef, automate, chef, chef-foundation, chef-universal, chef-backend, chef-server, chef-server-ha-provisioning, chef-workstation, chefdk, compliance, delivery, ha, harmony, inspec, mac-bootstrapper, manage, marketplace, omnibus-toolchain, omnibus-gcc, private-chef, push-jobs-client, push-jobs-server, reporting, supermarket, sync

@Tensibai
Copy link
Contributor Author

The PR linked has been merged. It means you can have a file defining cinc products with their endpoints and an environment variable pointing toward it.

This file hasn't been created on cinc-client yet however.

@tmoritoki0227
Copy link

The PR linked has been merged. It means you can have a file defining cinc products with their endpoints and an environment variable pointing toward it.

This file hasn't been created on cinc-client yet however.

@Tensibai
Hello. I'm using cinc-client 18.1.0 and I'm running into this problem, can anyone tell me what the new cinc-client does to solve it? I just recently touched cinc-client, so it would be helpful if you could tell me in detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants