errtracker: report if snapd did re-execute itself #3423

Merged
merged 1 commit into from Jun 1, 2017

Conversation

Projects
None yet
4 participants
Contributor

zyga commented Jun 1, 2017

Re-execution affects which internal tools and which snapd is used.
while the current error report shows us hashes of both distribution
and core snapd we always need to guess which one is being used
by inspecting the version string. This makes it more obvious.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

mvo5 approved these changes Jun 1, 2017

errtracker/errtracker.go
@@ -91,6 +91,13 @@ func snapConfineProfileDigest(suffix string) string {
return fmt.Sprintf("%x", md5.Sum(profileText))
}
+func detectReExec() string {
@pedronis

pedronis Jun 1, 2017

Contributor

not quite sure why the helper? wouldn't just returning true|false out of osutil.GetenvBool("SNAP_DID_REEXEC") be enough and change DidReExec => DidSnapdReExec ?

@zyga

zyga Jun 1, 2017

Contributor

The helper is just to match the return type so that it can be used below. I can rename the key in the map if that's what you want

@pedronis

pedronis Jun 1, 2017

Contributor

I would return yes|no and rename the field

@zyga

zyga Jun 1, 2017

Contributor

Done :-)

errtracker: report if snapd did re-execute itself
Re-execution affects which internal tools and which snapd is used.
while the current error report shows us hashes of both distribution
and core snapd we always need to guess which one is being used
by inspecting the version string. This makes it more obvious.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

thank you

codecov-io commented Jun 1, 2017

Codecov Report

Merging #3423 into master will decrease coverage by <.01%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3423      +/-   ##
==========================================
- Coverage   77.53%   77.52%   -0.01%     
==========================================
  Files         371      371              
  Lines       25544    25549       +5     
==========================================
+ Hits        19805    19807       +2     
- Misses       3985     3988       +3     
  Partials     1754     1754
Impacted Files Coverage Δ
errtracker/errtracker.go 73.49% <80%> (+0.41%) ⬆️
interfaces/sorting.go 86.66% <0%> (-10%) ⬇️
cmd/snap/cmd_aliases.go 96% <0%> (+2%) ⬆️

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 8911fd2...41eb7a1. Read the comment docs.

@mvo5 mvo5 merged commit 01dc6a3 into snapcore:master Jun 1, 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:feature/detect-re-exec branch Aug 22, 2017

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