Skip to content

[Bug]: Don't allow network rm if any containers reference the network. #392

@jglogan

Description

@jglogan

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

Currently container network rm guards against the removal of a network that is in use by running containers.

It should instead ensure that no containers reference the network.

Current behavior

% container network create foo
foo
% container create -it --rm --network foo --name web python:slim
web                              
% container network rm foo
foo
/Users/john/Documents/projects/jglogan/container main us-west-2e % container start web
Error: interrupted: "interrupted: "XPC connection error: Connection invalid"
Ensure container system service has been started with `container system start`."

Expected behavior

container network rm foo should fail, listing the containers that need to be removed first.

Environment

- OS: Tahoe preview
- Xcode: 26 beta
- Container: main

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

networkIssues and features associated with networking and DNS.nextItems in scope for the next few milestones

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions