implement auto upgrades of wins.exe via the SUC image #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Issue: rancher/rancher#47652
Problem
The
rancher-wins
system-upgrade-controller image does not automatically upgrade thewins.exe
binary on the host. This forces users to reprovision Windows nodes in order to obtain the latest version of thesystem-agent
andrancher-wins
, and has resulted in unnecessary changes in Rancher to handle behavior differences between different versions ofrancher-wins
.Solution
This PR introduces a new
host
package which embeds the latest version ofwins.exe
into the SUC image during compilation. When the SUC image runs, it will compare the version of wins installed onto the host (by invokingc:\Windows\wins.exe --version
) and, if needed, write the embedded version to disk into the required directories (c:\Windows
&c:\usr\local\bin
).This behavior can be disabled by setting the
CATTLE_WINS_SKIP_BINARY_UPGRADE
environment variable totrue
. This is required when running CI tests which do not fully installrancher-wins
.CI has been updated to cover this behavior during PRs and releases, ensuring that the proper version of
wins.exe
is always embedded into the SUC binary. Additionally, existing tests have been adjusted to ensure that we are tracking the proper exit code of certain commands.Extra Context
This PR does not handle automatic upgrades of the csiproxy. Additional investigation needs to be done regarding this component.