Merge pull request #17821 from umohnani8/detach

Add service ctr cleanup to PlayKubeDown
This commit is contained in:
OpenShift Merge Robot
2023-03-21 04:57:42 -04:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@ -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
}

View File

@ -619,8 +619,8 @@ spec:
- name: server
image: $IMAGE
command:
- sleep
- "5"
- echo
- "hello"
" > $fname
run_podman kube play --wait $fname