cmd/snap: correct devmode note for anomalous state #3361

Merged
merged 1 commit into from May 19, 2017

Conversation

Projects
None yet
4 participants
Contributor

zyga commented May 19, 2017

Past versions of snapd had a bug where snapd would lose the various
flags (like devmode) as a result of disable/enable operations.
In such state a snap would behave as if it was installed in jailmode
(the devmode flag was not set and confinement was strict) but the
output of "snap list" would still show it as devmode.

The cause of this is that in absence of the devmode flag we would look
at confinement type (what the snap declares the confinement should be).
This discrepancy between how the snap operates (strict) and how we show
it (devmode) can cause unwanted confusion. While we want to show an
useful "corrupted state" message later on we should not complicate how
the devmode note is computed. This patch makes us derive the devmode
note directly from the devmode flag.

Forum: https://forum.snapcraft.io/t/anomalous-snap-list-devmode-flag/699
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

cmd/snap: correct devmode note for anomalous state
Past versions of snapd had a bug where snapd would lose the various
flags (like devmode) as a result of disable/enable operations.
In such state a snap would behave as if it was installed in jailmode
(the devmode flag was *not* set and confinement was strict) but the
output of "snap list" would still show it as devmode.

The cause of this is that in absence of the devmode flag we would look
at confinement type (what the snap declares the confinement should be).
This discrepancy between how the snap operates (strict) and how we show
it (devmode) can cause unwanted confusion. While we want to show an
useful "corrupted state" message later on we should not complicate how
the devmode note is computed. This patch makes us derive the devmode
note directly from the devmode flag.

Forum: https://forum.snapcraft.io/t/anomalous-snap-list-devmode-flag/699
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Codecov Report

❗️ No coverage uploaded for pull request base (master@7b2b7d2). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3361   +/-   ##
=========================================
  Coverage          ?   77.53%           
=========================================
  Files             ?      366           
  Lines             ?    25146           
  Branches          ?        0           
=========================================
  Hits              ?    19498           
  Misses            ?     3899           
  Partials          ?     1749
Impacted Files Coverage Δ
cmd/snap/notes.go 79.66% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b2b7d2...1bd0039. Read the comment docs.

@chipaca chipaca merged commit 57eaf8f into snapcore:master May 19, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@zyga zyga deleted the zyga:fix/ghastly-devmode branch May 19, 2017

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