Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

fix: k8s upgrades not working in airgapped environments #265

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

emosbaugh
Copy link
Member

No description provided.

pkg/upgrade/upgrade.go Outdated Show resolved Hide resolved
@emosbaugh emosbaugh force-pushed the emosbaugh/sc-109434/fix-upgrade-tests branch 2 times, most recently from 62cb667 to 671e55a Compare July 30, 2024 13:09
@emosbaugh emosbaugh marked this pull request as ready for review July 30, 2024 13:10
// if we are running in an airgap environment all assets are already present in the
// node and are served by the local-artifact-mirror binary listening on localhost
// port 50000. we just need to get autopilot to fetch the k0s binary from there.
k0surl = "http://127.0.0.1:50000/bin/k0s-upgrade"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was missing from the original refactor

// the one that copies the artifacts to the nodes and the second one is the one that
// actually upgrades the k0s version. we need to make sure that this is the second plan
// before setting the installation state to the plan state.
if isAutopilotUpgradeToVersion(&plan, desiredVersion) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was needed otherwise an upgrade was never attempted as it would set the status to kubernetesinstalled based on the distribute airgap artifacts plan. the rest is just moving some code around.

@emosbaugh emosbaugh force-pushed the emosbaugh/sc-109434/fix-upgrade-tests branch from 4a56513 to 2daee23 Compare July 30, 2024 13:20
@emosbaugh emosbaugh changed the title fix: upgrades not working in airgapped environments fix: k8s upgrades not working in airgapped environments Jul 30, 2024
@emosbaugh emosbaugh merged commit 3952c50 into main Jul 30, 2024
6 checks passed
@emosbaugh emosbaugh deleted the emosbaugh/sc-109434/fix-upgrade-tests branch July 30, 2024 13:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants