mirror of
https://github.com/containers/podman.git
synced 2025-10-12 08:45:37 +08:00
service container: less verbose error logs
While manually playing with --service-container, I encountered a number of too verbose logs. For instance, there's no need to error-log when the service-container has already been stopped. For testing, add a new kube test with a multi-pod YAML which will implicitly show that #17024 is now working. Fixes: #17024 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -135,7 +135,9 @@ func (p *Pod) maybeStopServiceContainer() error {
|
||||
}
|
||||
logrus.Debugf("Stopping service container %s", serviceCtr.ID())
|
||||
if err := serviceCtr.Stop(); err != nil {
|
||||
logrus.Errorf("Stopping service container %s: %v", serviceCtr.ID(), err)
|
||||
if !errors.Is(err, define.ErrCtrStopped) {
|
||||
logrus.Errorf("Stopping service container %s: %v", serviceCtr.ID(), err)
|
||||
}
|
||||
}
|
||||
})
|
||||
return nil
|
||||
@ -239,7 +241,9 @@ func (p *Pod) maybeRemoveServiceContainer() error {
|
||||
timeout := uint(0)
|
||||
logrus.Debugf("Removing service container %s", serviceCtr.ID())
|
||||
if err := p.runtime.RemoveContainer(context.Background(), serviceCtr, true, false, &timeout); err != nil {
|
||||
logrus.Errorf("Removing service container %s: %v", serviceCtr.ID(), err)
|
||||
if !errors.Is(err, define.ErrNoSuchCtr) {
|
||||
logrus.Errorf("Removing service container %s: %v", serviceCtr.ID(), err)
|
||||
}
|
||||
}
|
||||
})
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user