-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add pod logs for terminated container in status check. #4303
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4303 +/- ##
==========================================
- Coverage 71.85% 71.74% -0.11%
==========================================
Files 324 324
Lines 12449 12468 +19
==========================================
Hits 8945 8945
- Misses 2935 2954 +19
Partials 569 569
Continue to review full report at Codecov.
|
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.
This is a great addition.
pkg/diag/validator/pod.go
Outdated
lines := strings.Split(string(logs), "\n") | ||
for i, s := range lines { | ||
lines[i] = fmt.Sprintf("[%s %s]%s", po.Name, c, s) | ||
} |
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 think this output formatting should be moved into Deployment.ReportSinceLastUpdated()
. Just gather it here.
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 only issue, we dont' have the container name in the pod status. hence i added it here.
Also, if any other tool uses the diag
library, they could rely on logs as is.
Relates #3952
In this Pr, add logs for containers which are not healthy. These logs are now on the command line.
TODO: @balopat should these also be part of the Event API ?
On master previously, without pod logs for terminated containers,
skaffold dev
the pods get cleaned up. There is no way for users to access these logs afterskaffold dev
loop.On this branch,