-
Notifications
You must be signed in to change notification settings - Fork 112
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
[SHACK-179] Support for upgrading chef-client #112
Conversation
9a0c3d8
to
0d29f50
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.
One minor comment but I think this is looking good so far
# installer action | ||
end | ||
manifest_content = backend.file(manifest_path).content | ||
# TODO - handle where it is installed, but at such an old version there is no manifest? |
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 something worth fixing as part of this PR. Perhaps if the manifest file does not exist we can return a version of 0.0.0
? That would force an upgrade
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.
It occurs to me that we do, indirectly - if the file content is nil, we treat it as not installed.
ce756ca
to
48a4a1c
Compare
We plan to support a wide range of target operating systems, | ||
but during this targeted pre-release we are constraining our efforts | ||
We plan to support a range of target operating systems, | ||
but during this targeted beta we are constraining our efforts | ||
to Windows and Linux. |
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.
Windows and Linux but not OSX?
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.
For the target host, yeah - at least for now: https://chefio.slack.com/archives/C8PKULC6S/p1525963099000551
Outstanding items have been completed. There is further discussion around whether we want the default desired behavior to be an upgrade, or if this should require explicit action on the part of the operator. Any changes as a result of that discussion will be implemented under a separate PR. |
1fd1c92
to
cc3f341
Compare
@@ -3,20 +3,11 @@ | |||
require "chef-workstation/action/install_chef/linux" | |||
|
|||
module ChefWorkstation::Action::InstallChef | |||
def self.instance_for_target(target_host, opts = {}) | |||
def self.instance_for_target(target_host, opts = { check_only: false }) |
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.
Moved the 'unsupported os' logic into TargetHost, so that we can start the process of not scattering OS-specific behaviors in places that don't need to worry about it.
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 is a tentative approval pending our conversation at standup about wether we want to default to upgrade or not.
requires a minimum version of %2. | ||
|
||
Re-running this command without the '--no-install' flag will permit | ||
me to automatically upgrade the target to the latest Chef client. |
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.
We don't need to change this but we should decide what we want. I personally don't like tools the personify themselves such as 'me' in this message. I'd rather see it say something like:
Re-running this command without the '--no-install' flag will automatically perform the installation.
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'm alright with the new wording. In general I like personification for a couple of reasons:
- it gives more of a feel with interacting with an agent doing work on your behalf
- it avoid awkward phrasing that exists only to avoid naming a sentence subject. (Your suggestion avoids this pitfall)
873f8eb
to
84100d6
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.
One request but 🚀 🍰 otherwise!
long: "--[no-]install", | ||
default: true, | ||
description: T.install_description(Action::InstallChef::Base::MIN_CHEF_VERSION) | ||
|
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 think this needs boolean: true
also
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.
LGTM
# will get re-visited once we determine how we want automatic | ||
# upgrades to behave. | ||
# @upgrading = true | ||
# perform_local_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.
Thanks for the comment
055efa5
84100d6
to
055efa5
Compare
055efa5
to
79cbc60
Compare
This change updates the install action to perform installation when chef client is present on the target, but below minimum version. The converge command and i18n has been updated to report whether an upgrade or install is being performed, and to include version info in install messages.
The --no-install flag will prevent install or upgrade of the target's chef client installation. If an update or installation is required, an appropriate error message is shown with instructions on permitting the change. This also improves in-task error handling so that the UI gets a chance to be refreshed when a task fails. Previously the error would be reported, but the summary 'spinner' line would never be updated for the failure.
This continues the move of consolidating all target-related lookups and translations into TargetHost, which is the only place that should need to know about them. This change also adds test coverage for the new TargetHost methods get_chef_version_manifest, base_os, and installed_chef_version.
Until we determine how we want to handle upgrading chef client on workstation-managed nodes, we have decided to disable the behavior of automatically upgrading out-of-date chef clients This changes the wording of CHEFINS003 to reflect that, and changes the install action so that it will simply raise if the chef client installation is out of date instead of conditionally continuing.
79cbc60
to
e58a142
Compare
This change updates the install action to verify that the target host
is running a minimum chef client version, and show an error when they are not.
It contains the logic to automatically upgrade, but that path has been disabled until
we determine how to best safely handle automatic upgrades.
The converge command and i18n has been updated to report
whether an upgrade or install is being performed, and to include
version info in install messages.
This also includes:
TODO: