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

If API calls for kube play --replace, then replace pod #20744

Merged
merged 1 commit into from
Nov 25, 2023

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Nov 22, 2023

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?

Remote API for podman kube play now supports replace=true

Copy link
Contributor

openshift-ci bot commented Nov 22, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2023
@@ -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
Copy link
Member

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)

@mheon
Copy link
Member

mheon commented Nov 22, 2023

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]>
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan rhatdan added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2023
@openshift-merge-bot openshift-merge-bot bot merged commit 1486ee5 into containers:main Nov 25, 2023
93 checks passed
@jonikkone
Copy link

Will this fix be in 4.8.x also, or only on 5.x.y?

@mheon
Copy link
Member

mheon commented Nov 29, 2023

/cherry-pick v4.8

@openshift-cherrypick-robot
Copy link
Collaborator

@mheon: new pull request created: #20832

In response to this:

/cherry-pick v4.8

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.

@mheon
Copy link
Member

mheon commented Nov 29, 2023

The patch applies cleanly to the 4.8 branch, so this should land in v4.8.1 some time in the next few weeks.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Feb 28, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants