mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
Add service ctr cleanup to PlayKubeDown
Since we can't guarantee when the worker queue will come and clean up the service container in the remote case when podman kube play --wait is called, cleanup the service container at the end of PlayKubeDown() to ensure that it is removed right after all the containers, pods, volumes, etc are removed. [NO NEW TESTS NEEDED] Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
@ -1366,6 +1366,15 @@ func (ic *ContainerEngine) PlayKubeDown(ctx context.Context, body io.Reader, opt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove the service container to ensure it is removed before we return for the remote case
|
||||||
|
// Needed for the clean up with podman kube play --wait in the remote case
|
||||||
|
if reports.ServiceContainerID != "" {
|
||||||
|
_, err = ic.ContainerRm(ctx, []string{reports.ServiceContainerID}, entities.RmOptions{})
|
||||||
|
if err != nil && !errors.Is(err, define.ErrNoSuchCtr) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return reports, nil
|
return reports, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,8 +619,8 @@ spec:
|
|||||||
- name: server
|
- name: server
|
||||||
image: $IMAGE
|
image: $IMAGE
|
||||||
command:
|
command:
|
||||||
- sleep
|
- echo
|
||||||
- "5"
|
- "hello"
|
||||||
" > $fname
|
" > $fname
|
||||||
|
|
||||||
run_podman kube play --wait $fname
|
run_podman kube play --wait $fname
|
||||||
|
Reference in New Issue
Block a user