Open
Conversation
93c1db3 to
e3d419f
Compare
The root cause of submit() returning null container id was because _wait_for_status can raise inside create_container, between the zun creation and returning the zun object. By adding the zun container to a custom exception inside create_container, submit() can still populate self.id and self._status from the zun object. This also makes it possible to set details from the zun container status_reason and status_detail fields. Needs Review: submit() now raises a ContainerCreateWaitError, not ResourceError, which may break existing code which depends on handling that error. We might want to instead reraise a ResourceError from the new custom error.
Mark-Powers
reviewed
Feb 13, 2026
| super().__init__(message) | ||
|
|
||
|
|
||
| class ContainerCreateWaitError(RuntimeError): |
Contributor
There was a problem hiding this comment.
Can you subclass one of the python-chi base exceptions? The goal is to make it clear to the user if this is their issue or an issue with the service. I'm not sure if CHI@Edge exposes enough info for that.
| LOG.info("Starting container ...") | ||
| zun().containers.start(container.uuid) | ||
| try: | ||
| if platform_version == 2: |
Contributor
There was a problem hiding this comment.
Do we support version 1 anymore? I know all of the devices are on 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds unit-tests to cover some of the edge cases of container.submit()
there's a lot of branching logic, and the return types vary per branch, but this covers the most important current behavior and known issues.