Skip to content

fix(network-manager): handle null IPAM.Config in _subnet_in_use#33

Open
pmanko wants to merge 1 commit intomainfrom
fix/subnet-inuse-nonetype
Open

fix(network-manager): handle null IPAM.Config in _subnet_in_use#33
pmanko wants to merge 1 commit intomainfrom
fix/subnet-inuse-nonetype

Conversation

@pmanko
Copy link
Copy Markdown
Member

@pmanko pmanko commented Apr 18, 2026

Summary

Docker networks created without an address pool have `IPAM.Config` set
to explicit `null`. `.get("Config", [])` returns `None` in that case,
which blows up the subsequent iteration with `'NoneType' object is not
iterable` — the warning fires, `_subnet_in_use` returns `False` by
default, and the mock happily allocates an already-taken subnet.

Swap to `.get("Config") or []` so the fallback kicks in for both
`null` and `missing`.

How it was found

During local harness validation of the Madagascar seed flow. The mock
would warn `Failed to inspect existing Docker subnets: 'NoneType' object
is not iterable` after certain Docker states, and the next seed request
got an intermittent subnet-overlap.

Test plan

  • Seed flow (10 analyzer creates back-to-back) no longer logs the
    NoneType warning.

🤖 Generated with Claude Code

Some Docker networks (created without an address pool) have IPAM.Config
set to explicit null rather than omitted. `.get("Config", [])` returns
None in that case, blowing up the iteration with
  'NoneType' object is not iterable
and leaving subnet-in-use detection broken — the mock would then
happily allocate a subnet that's already taken.

Switch to `.get("Config") or []` so the fallback kicks in for both
missing and null.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant