-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Knife license comands and bootstrap updates #14559
Conversation
@ashiqueps Please fix lint and rebase on |
2eae3ec
to
fb71ac0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions for more idiomatic Ruby, curiosity around the entitlement id, and more broadly: Should there be tests around the new commands for any potential failure modes?
1fbebc2
to
b2acdf3
Compare
@@ -0,0 1,776 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon discussion, this seems to be a duplication of https://github.com/chef/mixlib-install/blob/main/lib/mixlib/install/generator/bourne/scripts/helpers.sh.erb ? Why aren't we using mixlib-install? We should just modify mixlib-install that allows for an optional parameter to add any necessary functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(If there are necessary breaking changes or high risk changes, we should bump version major or similar semantic communication)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we started working on these changes, the install.sh
endpoint was unavailable on the new download APIs. The architects suggested having a local copy of that file on the knife repo as a temporary solution.
Recently, the licensing team has added those endpoints and we thought of implementing it with the workstation licensing changes, But I've updated the code to use the new APIS.
To your second point, this is not a breaking or high-risk change. This will show a warning to the user to remind the necessity of getting a license and activating it, or otherwise, with Infra 19, things will not work as it is.
Please review and let me know your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashiqueps Ok, so I see that mixlib/install
is not included in chef. Looks like it might be a little more work than the quick and dirty solution here @jaymzh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashiqueps looking at mixlic-install
https://github.com/chef/mixlib-install/blob/main/lib/mixlib/install/generator/bourne.rb#L24 it looks like you can invoke one of the class methods or subclass/add a class method to generate what you want. This would save on duplication and prevent drift between the different scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try adding mixlib-install
and invoking the Mixlib::Install::Generator::Bourne.install_sh
or similar method (or create your own that calls get_script("helpers.sh", context)
to generate the helpers you need.
Hey @tpowell-progress, I've completely removed the I hope you requested this change because of the rewrite of the download script. Since that is handled now, I hope this will be fine. Please correct me if I am wrong. |
can you rebase on main to fix the vm tests? |
if test -f /usr/bin/<%= ChefUtils::Dist::Infra::CLIENT %>; then | ||
echo "-----> Existing <%= ChefUtils::Dist::Infra::PRODUCT %> installation detected" | ||
else | ||
echo "-----> Installing Chef Omnibus (<%= @config[:channel] %>/<%= version_to_install %>)" | ||
do_download ${install_sh} $tmp_dir/install.sh | ||
sh $tmp_dir/install.sh -P <%= @config[:bootstrap_product] %> -c <%= @config[:channel] %> -v <%= version_to_install %> | ||
bash $tmp_dir/install.sh -P <%= @config[:bootstrap_product] %> -c <%= @config[:channel] %> -v <%= version_to_install %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend leaving this as sh
command as not all OS's like macos and freebsd default to or have bash shell installed.
bash $tmp_dir/install.sh -P <%= @config[:bootstrap_product] %> -c <%= @config[:channel] %> -v <%= version_to_install %> | |
sh $tmp_dir/install.sh -P <%= @config[:bootstrap_product] %> -c <%= @config[:channel] %> -v <%= version_to_install %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug in the new install.sh script which is preventing us from using the sh shell. I've created a ticket to address this, but I am not sure when they are going to pick it up. https://progresssoftware.atlassian.net/browse/CHEF-16349
Signed-off-by: nikhil2611 <[email protected]>
Signed-off-by: nikhil2611 <[email protected]>
Signed-off-by: nikhil2611 <[email protected]>
Signed-off-by: nikhil2611 <[email protected]>
Signed-off-by: nikhil2611 <[email protected]>
Signed-off-by: Ashique P S <[email protected]>
Signed-off-by: Ashique P S <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
Signed-off-by: Ashique Saidalavi <[email protected]>
ea75856
to
9f883a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems way way way better, thanks for the cleanup!
Can you address Corey's feedback though?
Signed-off-by: Ashique Saidalavi <[email protected]>
Quality Gate passedIssues Measures |
Hey @tpowell-progress, @Stromweld , @jaymzh, I've addressed all the comments. Could you please review this again? |
Created #14669 to the |
Description
Added the following commands:
Bootstrap updates:
Related Issue
Types of changes
Checklist:
Gemfile.lock
has changed, I have used--conservative
to do it and included the full output in the Description above.