Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

rkt: fix panic on rm a non-existing pod with uuid-file #2679

Merged
merged 2 commits into from May 24, 2016

Conversation

iaguis
Copy link
Member

@iaguis iaguis commented May 24, 2016

We were trusting that the value in the uuid file referred to an existing
pod, which caused a panic if that wasn't the case.

In this commit we resolve the UUID to check if the pod actually exists.

Also, make rm's behavior consistent between caling it with a pod UUID
and with --uuid-file:

  • Print a similar error message
  • Set the exit status to 1 if we fail to remove any pod

There's no tests for rkt rm. I add some in #2655. I can add a test-case for this there.

Fixes #2678

@jonboulle
Copy link
Contributor

lgtm - test?

@iaguis
Copy link
Member Author

iaguis commented May 24, 2016

Added tests.

We were trusting that the value in the uuid file referred to an existing
pod, which caused a panic if that wasn't the case.

In this commit we resolve the UUID to check if the pod actually exists.

Also, make rm's behavior consistent between caling it with a pod UUID
and with `--uuid-file`:

* Print a similar error message
* Set the exit status to 1 if we fail to remove any pod
@iaguis
Copy link
Member Author

iaguis commented May 24, 2016

Rebased. PTAL.

@lucab
Copy link
Member

lucab commented May 24, 2016

LGTM

@lucab lucab merged commit 8f74d28 into rkt:master May 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime error when rm non-existing pod with uuid-file option
3 participants