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

Prevent automatic snap upgrades #8

Merged
merged 8 commits into from
Nov 21, 2023
Merged

Prevent automatic snap upgrades #8

merged 8 commits into from
Nov 21, 2023

Conversation

mateoflorido
Copy link
Member

Summary

This pull request implements a mechanism to prevent automatic upgrades.

Changes

  • Prevent automatic snap upgrades when the channel parameter is changed.
  • Display BlockedStatus if the channel parameter has changed and an upgrade is required.

Copy link
Member

@addyess addyess left a comment

Choose a reason for hiding this comment

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

Couple of nits here and there... You'll make easy fixes

charms/kubernetes_snaps.py Show resolved Hide resolved
charms/kubernetes_snaps.py Outdated Show resolved Hide resolved
charms/kubernetes_snaps.py Outdated Show resolved Hide resolved
Comment on lines +621 to +627
for snap in BASIC_SNAPS:
install_snap(
snap,
channel=channel,
classic=True,
ignore_running=snap == "kubectl",
)
Copy link
Member

Choose a reason for hiding this comment

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

❤️

Comment on lines +630 to +631
for snap in CONTROL_PLANE_SNAPS:
install_snap(snap, channel=channel)
Copy link
Member

Choose a reason for hiding this comment

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

❤️ ❤️

charms/kubernetes_snaps.py Outdated Show resolved Hide resolved
Copy link
Member

@addyess addyess left a comment

Choose a reason for hiding this comment

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

LGTM

@mateoflorido mateoflorido merged commit 92405c5 into main Nov 21, 2023
6 checks passed
@mateoflorido mateoflorido deleted the m/upgrade branch November 21, 2023 22:23
Comment on lines +614 to +616
status.add(
BlockedStatus("Snap channel version has changed. An upgrade is required.")
)
Copy link
Member

Choose a reason for hiding this comment

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

@mateoflorido do you see any trouble changing this text to match the previous message in reactive:

Needs manual upgrade, run the upgrade action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants