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
Conversation
errtracker/errtracker.go
Outdated
@@ -91,6 +91,13 @@ func snapConfineProfileDigest(suffix string) string { | |||
return fmt.Sprintf("%x", md5.Sum(profileText)) | |||
} | |||
|
|||
func detectReExec() string { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
8757f47
to
41eb7a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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