diff options
author | Valentin Rothberg <vrothberg@redhat.com> | 2023-01-10 15:36:45 +0100 |
---|---|---|
committer | Valentin Rothberg <vrothberg@redhat.com> | 2023-01-12 14:09:23 +0100 |
commit | d2fb6cf05dff575f53f0ab7773512f1a0d45c54e (patch) | |
tree | 8e2c9847f7075a508cbea85a733ec34d88f8a5ab /libpod/service.go | |
parent | 4bbe2ee012aec2283247e06b7a9066906b2cc92e (diff) |
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>
Diffstat (limited to 'libpod/service.go')
-rw-r--r-- | libpod/service.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libpod/service.go b/libpod/service.go index e234254d5..3304c73e0 100644 --- a/libpod/service.go +++ b/libpod/service.go @@ -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 |