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

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

Merged
merged 1 commit into from Jun 1, 2017

Conversation

zyga
Copy link
Collaborator

@zyga 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

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

func detectReExec() string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would return yes|no and rename the field

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done :-)

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>
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.

thank you

@codecov-io
Copy link

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
@zyga zyga deleted the feature/detect-re-exec branch August 22, 2017 09:23
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