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

Remove rkt pods when exiting #3562

Merged
merged 2 commits into from
Nov 17, 2017
Merged

Remove rkt pods when exiting #3562

merged 2 commits into from
Nov 17, 2017

Conversation

schmichael
Copy link
Member

Fixes #3561

if err := cmd.Run(); err == nil {
t.Fatalf("expected error running 'rkt status %s' on removed container", handle.uuid)
}
if out := stderr.String(); !strings.Contains(out, "no matches found") {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems brittle if the returned error message ever changes, but other than checking for a non empty error message I don't have a better idea.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I hate resorting to strings.Contains, but if it ever fails due to a string change it should be a quick and easy fix (and caught by Travis, not a user at runtime).

@@ -781,6 +789,13 @@ func (h *rktHandle) run() {
}
h.pluginClient.Kill()

// Remove the pod
if err := rktRemove(h.uuid); err != nil {
h.logger.Printf("[ERR] driver.rkt: error removing pod %q - must gc manually", h.uuid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Print the error

@@ -781,6 +789,13 @@ func (h *rktHandle) run() {
}
h.pluginClient.Kill()

// Remove the pod
if err := rktRemove(h.uuid); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking: Should it use the created resources feature so that cleanup gets retried?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried to match Docker's behavior and this is how we do it there. I'll update rkt to use created resources.

Copy link
Member Author

Choose a reason for hiding this comment

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

Investigated this route and it's a bit more work than I'd like to put in this PR. It involves returning CreatedResources from Driver.Start which isn't already happening and ensuring TaskDriver cleans up containers exactly when desired. Following Dockers lead for now seems safest.

@schmichael schmichael merged commit 96f56ce into master Nov 17, 2017
@schmichael schmichael deleted the b-3561-rkt-rm branch November 17, 2017 01:30
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants