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

feat(snap): avoid refresh on package_upgrade: true and refresh.hold #5426

Merged
merged 2 commits into from
Aug 7, 2024

Commits on Jul 12, 2024

  1. feat(snap): avoid refresh on package_upgrade: true and refresh.hold

    When snap refresh.hold is set to forever, an admin is saying they do
    not want generic automated refreshes of snaps performed by default.
    
    This should be an indicator to cloud-init to avoid calling snap refresh
    on such systems due to a `package_upgrade: true` present in user-data.
    
    For network-limited environments with images which have the snap package
    manager but don't want to wait and timeout on snap refresh, the following
    user-data can be provided to still allow for package_upgrade: true,
    and avoid a 20-30 second wait on snaps being unable to access certain
    snap URLs.
    
       #cloud-config
       package_upgrade: true
       snap:
         commands:
           00: snap refresh --hold=forever
    
    cloud-init now interrogates the state refresh.hold value by calling
      snap get system -d
    
    If snap refresh --hold was called in that environment to set 'forever',
    cloud-init will skip calling refresh and log the reason for skipping.
    
    We cannot honor short time-based refresh.holds because the snap
    services place a short hold in early boot anyway as systemd units
    startup.
    
    Fixes: canonicalGH-5290
    blackboxsw committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    3dbdade View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Configuration menu
    Copy the full SHA
    4151ddd View commit details
    Browse the repository at this point in the history