mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
"pod pause/unpause/stop" append "report.Errs" to "reports"
There is a possibility that podman does not output expected error message. (e.g. When pause rootless cgroups v1 container on host) This problem is solved by appending `report.Errs` to `reports` before `continue`. [NO NEW TESTS NEEDED] Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:

committed by
Matthew Heon

parent
409fbeaaba
commit
de8d2cc944
@ -138,6 +138,7 @@ func (ic *ContainerEngine) PodPause(ctx context.Context, namesOrIds []string, op
|
|||||||
errs, err := p.Pause(ctx)
|
errs, err := p.Pause(ctx)
|
||||||
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
||||||
report.Errs = []error{err}
|
report.Errs = []error{err}
|
||||||
|
reports = append(reports, &report)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
@ -171,6 +172,7 @@ func (ic *ContainerEngine) PodUnpause(ctx context.Context, namesOrIds []string,
|
|||||||
errs, err := p.Unpause(ctx)
|
errs, err := p.Unpause(ctx)
|
||||||
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
||||||
report.Errs = []error{err}
|
report.Errs = []error{err}
|
||||||
|
reports = append(reports, &report)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
@ -196,6 +198,7 @@ func (ic *ContainerEngine) PodStop(ctx context.Context, namesOrIds []string, opt
|
|||||||
errs, err := p.StopWithTimeout(ctx, false, options.Timeout)
|
errs, err := p.StopWithTimeout(ctx, false, options.Timeout)
|
||||||
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
||||||
report.Errs = []error{err}
|
report.Errs = []error{err}
|
||||||
|
reports = append(reports, &report)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
|
Reference in New Issue
Block a user