New `snap switch` command


#1

During one of the recent conferences the topic of snap switch came up. The idea is that there should be a command that lets can switch the channel of a snap easily without refreshing to it right away. The functionality is largely provided by snap refresh --channel=$CHANNEL $SNAP. But the later will always do a refresh and only switch the channel if the refresh worked. In some cases (airplane with no network) it may be desirable to just switch for later.

Small branch with this feature: https://github.com/snapcore/snapd/pull/2807


#2

how would that work if the revision does not actually exist in the target channel … would it switch back to the former channel once you are back online ? would it stay on that channel with a non-existing revision and hope that a higher one comes up eventually ?


#3

The answer is the same as what happens when you install a revision and that revision is taken out of the current channel: the channel defines what should be installed, and if there’s nothing available there’s nothing to change.