Return Object Changes and State Handling Fixup #905
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Return Object Changes and State Handling Fixup
Description
This PR changes the way the
start_container
,stop_container
, anddestroy_container
functions work. They still return a container object as expected, but that object is now made from the actual response we receive from Rancher (which is not just a empty 204, but the full json for the container question), not anotherget_container
call.This is most certainly the better way to handle this:
State Handling Fix
While the above output shows that our return objects are much better, it shows another issue. For some reason,
state=terminated
when we're in the process of a transition (starting, stopping, etc..). Looking deeper, I found myelif
for terminated state doesn't work as expected. I've fixed this by usingany
. I've also modified the tests to properly check for this.Now it works as expected:
Status
Checklist (tick everything that applies)