USHIFT-1465 Refactor prerun logs#2177
Conversation
|
Nice polishing work. +1 |
5d86766 to
8f1273f
Compare
|
/test microshift-metal-tests |
8f1273f to
d285ecd
Compare
pkg/admin/prerun/version.go
Outdated
There was a problem hiding this comment.
Do we want to put this in defer?
pmtk
left a comment
There was a problem hiding this comment.
I'm not rejecting the suggestions - if team members would find it more useful to use defers unconditionally on "end" messages and extend the "unit of work" logs to be more of "function scope", then we can do that.
But before we do this, I would recommend to take a look how the logs look like (sos from this PR's presubmits) because I was considering these defers (they might be even present in earlier commits), but I didn't like how the looked like in practice and, personally, I found them slightly confusing
650f626 to
258ec80
Compare
258ec80 to
f29a0ed
Compare
|
This looks good to me. Holding off in case others would want to take a look. |
dhellmann
left a comment
There was a problem hiding this comment.
Looks mostly good. I have a couple of thoughts inline, and 1 question about logging verbosity before we merge it.
| outputToLog := stdout.String() | ||
| outputToLog = strings.ReplaceAll(outputToLog, "\n", "") | ||
| outputToLog = strings.ReplaceAll(outputToLog, " ", "") | ||
| klog.InfoS("rpm-ostree status", "output", outputToLog) |
There was a problem hiding this comment.
If this produces a lot of data, we might want to consider not logging it ourselves and relying on sos to capture it instead. Let's keep it, and see how it goes.
| ) | ||
|
|
||
| func isUpgradeBlocked(execVersion versionMetadata, dataVersion versionMetadata) error { | ||
| klog.InfoS("START obtaining list of blocked upgrades") |
There was a problem hiding this comment.
I wonder each step here really needs to be a separate "unit of work". The whole function might be 1 unit doing the work of "checking upgrade compatibility" or something, from the user's perspective. If any of the internal steps is relatively slow, that could indicate that step should be a separate unit, but I think they're all pretty fast, right?
Let's keep this, but think more about where we draw the line about what a "unit" is and see if we can find the right balance.
There was a problem hiding this comment.
I'm wondering that myself, but given time constraints and feature being young, I'd rather have too verbose logs than not enough of them (and it's only about 60 lines)
| } | ||
|
|
||
| func getVersionOfData() (versionMetadata, error) { | ||
| klog.InfoS("START reading version file") |
There was a problem hiding this comment.
How often are these messages going to show up? How often do we read that file?
There was a problem hiding this comment.
Once per boot MicroShift start
|
Examples of version related logs (I'm looking into |
01ab5df to
e296eee
Compare
|
/test microshift-e2e-arm |
|
@pmtk: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/unhold |
|
/lgtm |
|
/hold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggiguash, pmtk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
No description provided.