-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
If API calls for kube play --replace, then replace pod #20744
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/domain/infra/abi/play.go
Outdated
@@ -714,6 +714,11 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY | |||
podSpec.PodSpecGen.ServiceContainerID = serviceContainer.ID() | |||
} | |||
|
|||
if options.Replace { | |||
if _, err := ic.PodRm(ctx, []string{podName}, entities.PodRmOptions{Force: true, Ignore: true}); err != nil { | |||
return nil, nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap the error? fmt.Errorf("replacing pod %s: %w", podName, err)
One nit otherwise LGTM |
Currently if user specifies podman kube play --replace, the pod is removed on the client side, not the server side. If the API is called with replace=true, the pod was not being removed and this called the API to fail. This PR removes the pod if it exists and the caller specifies replace=true. Fixes: containers#20705 Signed-off-by: Daniel J Walsh <[email protected]>
Ephemeral COPR build failed. @containers/packit-build please check. |
LGTM |
Will this fix be in 4.8.x also, or only on 5.x.y? |
/cherry-pick v4.8 |
@mheon: new pull request created: #20832 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The patch applies cleanly to the 4.8 branch, so this should land in v4.8.1 some time in the next few weeks. |
Currently if user specifies podman kube play --replace, the pod is removed on the client side, not the server side. If the API is called with replace=true, the pod was not being removed and this called the API to fail. This PR removes the pod if it exists and the caller specifies replace=true.
Fixes: #20705
Does this PR introduce a user-facing change?