From 52a52eee788cca44242e92bf58944cdf2697ee66 Mon Sep 17 00:00:00 2001 From: anti Date: Sun, 10 May 2026 00:56:56 -0400 Subject: [PATCH] fix(network): reload network before checking Containers on IPAM drift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit networks.list() returns bare objects — Containers is always empty without a reload(). The active-endpoint guard from the prior commit never fired because it was checking a stale empty dict. --- decnet/network.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/decnet/network.py b/decnet/network.py index c52d187c..b0378dfa 100644 --- a/decnet/network.py +++ b/decnet/network.py @@ -151,6 +151,13 @@ def _ensure_network( options.update(extra_options) for net in client.networks.list(names=[MACVLAN_NETWORK_NAME]): + # networks.list() doesn't populate Containers — reload to get the + # full inspect payload (including connected container IDs). + try: + net.reload() + except docker.errors.APIError: + pass + if net.attrs.get("Driver") == driver: # Same driver — but if the IPAM pool drifted (different subnet, # gateway, or ip-range than this deploy asks for), reusing it