Skip to content

refactor: enhance CLI robustness, optimize container cleanup, and secure defaults#1718

Open
Raxyl00 wants to merge 1 commit into
apple:mainfrom
Raxyl00:feature/improve-container
Open

refactor: enhance CLI robustness, optimize container cleanup, and secure defaults#1718
Raxyl00 wants to merge 1 commit into
apple:mainfrom
Raxyl00:feature/improve-container

Conversation

@Raxyl00

@Raxyl00 Raxyl00 commented Jun 13, 2026

Copy link
Copy Markdown

refactor: enhance CLI robustness, optimize container cleanup, and secure defaults

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Currently, the codebase contains several minor issues and TODOs that impact runtime safety and efficiency:

  1. Writing output to stdout/stderr in ProcessIO uses try!, which crashes the CLI abruptly if the output pipe is closed early (e.g. container run ... | head -n 5).
  2. Container cleanup in ContainersService reads the configuration file from disk unnecessarily to deregister launchd services, even though the state configuration is already loaded in memory.
  3. Static defaults for memory sizes utilize force unwraps (try!), which are brittle and would cause silent crashes at daemon startup if parsing fails.

This change resolves these items, improving CLI pipeline stability, speeding up container cleanup, and making configuration defaults safer.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

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