Clean up container registration but keep container alive. This function implements the cleanup phase: - Removes container from database - Leaves container running for debugging Args: container_id: Container ID to clean up db: Database instance (creates new if None)
(
container_id: str, db: Optional[ContainerDatabase] = None
)
| 584 | |
| 585 | |
| 586 | def cleanup_container( |
| 587 | container_id: str, db: Optional[ContainerDatabase] = None |
| 588 | ) -> None: |
| 589 | """Clean up container registration but keep container alive. |
| 590 | |
| 591 | This function implements the cleanup phase: |
| 592 | - Removes container from database |
| 593 | - Leaves container running for debugging |
| 594 | |
| 595 | Args: |
| 596 | container_id: Container ID to clean up |
| 597 | db: Database instance (creates new if None) |
| 598 | """ |
| 599 | if db is None: |
| 600 | db = ContainerDatabase() |
| 601 | |
| 602 | # Remove from DB (container stays alive) |
| 603 | db.delete_by_id(container_id) |
| 604 | |
| 605 | print( |
| 606 | f"Container {container_id} released. Container still running for debugging. " |
| 607 | f"Use 'docker stop {container_id}' to stop it." |
| 608 | ) |
| 609 | |
| 610 | |
| 611 | def cleanup_orphaned_containers(db: Optional[ContainerDatabase] = None) -> int: |
nothing calls this directly
no test coverage detected