Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service ctr cleanup to PlayKubeDown #17821

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/domain/infra/abi/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions test/system/700-play.bats
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ spec:
- name: server
image: $IMAGE
command:
- sleep
- "5"
- echo
- "hello"
" > $fname

run_podman kube play --wait $fname
Expand Down