Skip to content

Modern Docker Management, Designed for Everyone

fix(docker): count default networks as in use (#4476)

Kyle Mendell351fdfffc07d
diff --git a/backend/internal/docker/service.go b/backend/internal/docker/service.go
index 5c351238f..c3cecacfc 100644
--- a/backend/internal/docker/service.go
+++ b/backend/internal/docker/service.go
@@ -480,8 +480,9 @@ func (s *DockerClientService) GetAllNetworks(ctx context.Context) ([]network.Sum
if err != nil {
return nil, 0, 0, 0, err
}
- inuse, unused, total := CountNetworkUsage(networks, containers)
- return networks, inuse, unused, total, nil
+ _, unused, total := CountNetworkUsage(networks, containers)
+ // Default networks are never unused, matching the network list counts.
+ return networks, total - unused, unused, total, nil
}
// CountNetworkUsage returns in-use and unused counts for non-default networks, and the total of all networks.