Skip to content

fix(oci-javascript): use supported Podman network cleanup - #544

Open
playb0t wants to merge 1 commit into
oracle:mainfrom
playb0t:541-podman-network-cleanup
Open

playb0t wants to merge 1 commit into
oracle:mainfrom
playb0t:541-podman-network-cleanup

Conversation

@playb0t

@playb0t playb0t commented Nov 2, 2026

Copy link
Copy Markdown

Description

Podman 5.7.0 has no --ignore flag on podman network rm, so every execution ended in isolation provider cleanup failed and left its network. The provider now:

  1. runs podman network exists <name> and accepts only exit 0 (present) or 1 (absent);
  2. removes a present network with podman network rm <name>, without --force or --ignore;
  3. if removal fails, checks again: an absent network means another cleanup removed it; a network that is still there, or a failed check, stays an error.

runPodman now returns the exit code and takes an explicit list of successful codes; existing callers keep the default [0]. The fake Podman in the tests accepts network exists and network rm <name> instead of asserting --ignore.

Fixes #541

Overlap: #431 changes the same files (podman.ts, the tests, the CHANGELOG) and still calls network rm --ignore; #495 shares the CHANGELOG and the sandbox tests. A textual conflict in the CHANGELOG is likely whichever merges first; I will rebase.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Six new regression tests in test/sandbox.test.ts (network present; already absent; exists exit 125; removal fails while the network is still present; the network disappears between check and removal; a failed re-check): all six fail on the unchanged provider and pass with this change.
  • The full package suite under c8 on main e75013f9: 161 passed, 0 failed, 0 skipped; line coverage 94.07%. buf generate, tsc -p tsconfig.build.json and tsc --noEmit pass.
  • Real rootless Podman 5.7.0 with the MCP TypeScript SDK 1.32.0 client against the built server: an ordinary call returns its result and a script error returns the error; in both cases the container and its network are removed before the reply. This run was on the earlier base bc096453; the files it exercises are byte-identical on e75013f9.

To verify:

cd src/oci-javascript-mcp-server
podman network rm --ignore some-name    # Podman 5.7: "Error: unknown flag: --ignore"
node --no-node-snapshot --experimental-strip-types --test \
  --test-name-pattern "Podman network cleanup compatibility" test/sandbox.test.ts

Test Configuration:

  • Toolchain: Node 26.8.1, npm 11.12.1, rootless Podman 5.7.0 (WSL2 Ubuntu, cgroup v2)
  • SDK: MCP TypeScript SDK 1.32.0

Not run: other Podman versions, other operating systems, the Moon wrapper.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (CHANGELOG entry)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules (none needed)

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

Generated-by: Codex:gpt-6.1-sol
Signed-off-by: Alex Gercog <w0rldlogic.0point@proton.me>
@playb0t
playb0t force-pushed the 541-podman-network-cleanup branch 2 times, most recently from bb38b31 to 6f5d575 Compare November 5, 2026 11:42

This branch has not been deployed

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

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oci-javascript-mcp-server: every run_javascript call fails cleanup on Podman 5.7, because podman network rm has no --ignore flag

1 participant