-
Notifications
You must be signed in to change notification settings - Fork 6
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
downgrade log messages for killing containers #80
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,9 +86,9 @@ func (p *cliWrapper) KillAndClean(containerName string) error { | |
cmdKill := p.getPodmanCmd("kill", containerName) | ||
p.logger.Debugf("Killing with command %v", cmdKill.Args) | ||
if err := cmdKill.Run(); err != nil { | ||
p.logger.Warningf("failed to kill pod %s, probably the execution terminated earlier", containerName) | ||
p.logger.Infof("failed to kill pod %s, probably the execution terminated earlier", containerName) | ||
} else { | ||
p.logger.Warningf("successfully killed container %s", containerName) | ||
p.logger.Infof("successfully killed container %s", containerName) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this even worth logging? Should it be a debug severity instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm. It could go either way. If it gets here, it means it was still running. I think it's better for it to finish on its own. But debug instead of no logging for sure. |
||
} | ||
|
||
msg := "removing container " + containerName | ||
|
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 one's tough without knowing the full context. If this is routine and expected, maybe it should be downgraded to debug. Maybe there should be more analysis of the response to determine whether "execution terminated earlier" (which is probably not worth logging at all) or whether the attempt failed for some other reason (which might warrant a warning or even error).
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 is a good thing, so debug or no logging.
In reality it should check to see if the container is still running instead of blindly killing it.