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

Cleanup kube play workloads if error happens #16750

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

umohnani8
Copy link
Member

If an error happening while playing a kube yaml,
clean up any pods, containers, and volumes that might have been created before the error was hit.
This improves the user experience for when they go to re-run the same yaml with their fixes and podman doesn't complain about any existing workloads from the previously failed run.

Suppress the clean up output when clean up happens after an error as the user doesn't need to see or know about that.

Signed-off-by: Urvashi Mohnani [email protected]

Does this PR introduce a user-facing change?

Clean up containers, pods, and volumes if an error happens while playing a kube yaml file.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 5, 2022
@umohnani8
Copy link
Member Author

@rhatdan PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM but note that the teardown-on-error had to happen in pkg/domain/infra/api if we want to include REST-API calls.

test/e2e/play_kube_test.go Outdated Show resolved Hide resolved
cmd/podman/kube/play.go Show resolved Hide resolved
@umohnani8 umohnani8 force-pushed the teardown branch 2 times, most recently from 9e38fff to 6ccd312 Compare December 6, 2022 19:13
@rhatdan
Copy link
Member

rhatdan commented Dec 7, 2022

@umohnani8 Rebase required.

@umohnani8
Copy link
Member Author

Rebased

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One non-blocking nit, LGTM

cmd/podman/kube/play.go Outdated Show resolved Hide resolved
@umohnani8 umohnani8 force-pushed the teardown branch 2 times, most recently from 9ace32f to 94b6dd1 Compare December 8, 2022 02:13
If an error happening while playing a kube yaml,
clean up any pods, containers, and volumes that might
have been created before the error was hit.
This improves the user experience for when they go to
re-run the same yaml with their fixes and podman doesn't
complain about any existing workloads from the previously
failed run.

Suppress the clean up output when clean up happens after an
error as the user doesn't need to see or know about that.

Signed-off-by: Urvashi Mohnani <[email protected]>
@umohnani8
Copy link
Member Author

This is ready to merge @mheon @rhatdan

@vrothberg
Copy link
Member

@flouthoc @giuseppe @Luap99 PTAL

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, umohnani8, vrothberg

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:
  • OWNERS [flouthoc,umohnani8,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vrothberg
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 9, 2022
@openshift-merge-robot openshift-merge-robot merged commit 02b7866 into containers:main Dec 9, 2022
@umohnani8 umohnani8 deleted the teardown branch February 23, 2023 18:44
@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 Sep 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2023
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