Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/cliwrapper/cliwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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).

Copy link
Contributor

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.

} else {
p.logger.Warningf("successfully killed container %s", containerName)
p.logger.Infof("successfully killed container %s", containerName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this even worth logging? Should it be a debug severity instead?

Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down
Loading