-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: treat pod deletion as if its containers were terminated #6587
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6587 +/- ##
==========================================
- Coverage 70.48% 70.29% -0.20%
==========================================
Files 515 517 +2
Lines 23150 23292 +142
==========================================
+ Hits 16317 16372 +55
- Misses 5776 5850 +74
- Partials 1057 1070 +13
Continue to review full report at Codecov.
|
pkg/skaffold/kubernetes/watcher.go
Outdated
@@ -114,6 +129,24 @@ func (w *podWatcher) Start(kubeContext string, namespaces []string) (func(), err | |||
continue | |||
} | |||
|
|||
if l.Logger.IsLevelEnabled(logrus.TraceLevel) { |
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.
is this check l.Logger.IsLevelEnabled(logrus.TraceLevel)
required? Doesn't l.Trace
already handle it? Is it to save the cost of constructing the 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.
Yeah, probably premature optimization: I thought the podWatcher fired more events than it actually does. This dereferencing seemed a bit distasteful but our output logger just returns a logrus object anyways.
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.
pkg/skaffold/kubernetes/watcher.go:25:2: Do not use github.com/sirupsen/logrus package, use output.log.Entry instead
😭
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.
wait you can add a allowlist of files here hack/tools/linters/logrus.go
Don't let the technology stop you!
// Ignore files
var ignoreFileSuffixes = []string{
// always ignore test files
"_test.go",
"pkg/skaffold/output/log/log.go",
"pkg/skaffold/event/v2/logger.go",
"pkg/skaffold/build/buildpacks/logger.go",
}
Fixes: #6586
Description