Skip to content

Bugs/container submit 409#94

Open
msherman64 wants to merge 5 commits intomasterfrom
bugs/container_submit_409
Open

Bugs/container submit 409#94
msherman64 wants to merge 5 commits intomasterfrom
bugs/container_submit_409

Conversation

@msherman64
Copy link
Contributor

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.

@msherman64 msherman64 force-pushed the bugs/container_submit_409 branch from 93c1db3 to e3d419f Compare February 12, 2026 17:22
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.
super().__init__(message)


class ContainerCreateWaitError(RuntimeError):
Copy link
Contributor

Choose a reason for hiding this comment

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

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we support version 1 anymore? I know all of the devices are on 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants