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

snapstate: undo a daemon restart on classic if needed #3757

Merged
merged 5 commits into from Aug 22, 2017

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Aug 17, 2017

If we are on classic and have no previous version of core
we may have restarted from a distro package into the core
snap. We need to undo that restart.

This is essentially #3750 without the controversial integration test.

See also
https://forum.snapcraft.io/t/snapd-not-restarting-on-revert/1679

If we are on classic and have no previous version of core
we may have restarted from a distro package into the core
snap. We need to undo that restart.

See also
https://forum.snapcraft.io/t/snapd-not-restarting-on-revert/1679
Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

lgtm, log message could be clearer though I think

// doUnlinkCurrentSnap() like we usually do when going from
// core snap -> next core snap
if release.OnClassic && newInfo.Type == snap.TypeOS && oldCurrent.Unset() {
t.Logf("Requested daemon restart (undo classic)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

undo classic initial core install?

@codecov-io
Copy link

codecov-io commented Aug 21, 2017

Codecov Report

Merging #3757 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3757      +/-   ##
==========================================
+ Coverage   75.84%   75.85%   +<.01%     
==========================================
  Files         399      399              
  Lines       34541    34551      +10     
==========================================
+ Hits        26197    26207      +10     
+ Misses       6481     6480       -1     
- Partials     1863     1864       +1
Impacted Files Coverage Δ
overlord/snapstate/handlers.go 65.1% <100%> (+0.31%) ⬆️
overlord/snapstate/snapstate.go 80.45% <0%> (-0.27%) ⬇️
cmd/snap/cmd_aliases.go 95% <0%> (+1.66%) ⬆️
interfaces/sorting.go 100% <0%> (+2.56%) ⬆️

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 2e4da98...f0e27c4. Read the comment docs.

@zyga
Copy link
Collaborator

zyga commented Aug 22, 2017

This failed iwth

----------------------------------------------------------------------

FAIL: picfg_test.go:124: piCfgSuite.TestConfigurePiConfigNoChangeSet

picfg_test.go:134:

    c.Check(st1.ModTime(), DeepEquals, st2.ModTime())

... obtained time.Time = time.Time{sec:63638909594, nsec:48592565, loc:(*time.Location)(0x7d4c80)} ("2017-08-21 10:53:14.048592565 +0000 UTC")

... expected time.Time = time.Time{sec:63638909594, nsec:52592533, loc:(*time.Location)(0x7d4c80)} ("2017-08-21 10:53:14.052592533 +0000 UTC")

@mvo5 mvo5 merged commit a2641f2 into snapcore:master Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants