Skip to content

Fix IPv6 address key typo in docker_network.present reconnect - #16

Open
mitar wants to merge 2 commits into
salt-extensions:mainfrom
mitar:docker-network-ipv6-address-key
Open

mitar wants to merge 2 commits into
salt-extensions:mainfrom
mitar:docker-network-ipv6-address-key

Conversation

@mitar

@mitar mitar commented Sep 21, 2026

Copy link
Copy Markdown

docker_network.present looked up "IPV6Address" (uppercase V) in the network-inspect data returned by docker.inspect_network, whose actual key is "IPv6Address" (lowercase v, same casing as the adjacent "IPv4Address" lookup on the previous line). The KeyError was silently swallowed by the surrounding try/except, so on every network recreation the reconnect call dropped the container's ipv6_address argument and Docker auto-assigned a random IPv6 from the pool. Containers with declared static IPv6 addresses would drift off them after any recreate, and subsequent docker_container.running states attempting to reclaim the declared addresses would fail with "403 Address already in use" because the wrong container was still holding them.

Merge requirements satisfied?

[NOTICE] Bug fixes or new features require tests.

Commits signed with GPG?

No

docker_network.present looked up "IPV6Address" (uppercase V) in the
network-inspect data returned by docker.inspect_network, whose actual key
is "IPv6Address" (lowercase v, same casing as the adjacent "IPv4Address"
lookup on the previous line). The KeyError was silently swallowed by the
surrounding try/except, so on every network recreation the reconnect call
dropped the container's ipv6_address argument and Docker auto-assigned a
random IPv6 from the pool. Containers with declared static IPv6 addresses
would drift off them after any recreate, and subsequent
docker_container.running states attempting to reclaim the declared
addresses would fail with "403 Address already in use" because the wrong
container was still holding them.
@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.61538% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.36%. Comparing base (cebd4c0) to head (918dbc1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tests/unit/states/test_docker_network.py 54.00% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
+ Coverage   42.10%   42.36%   +0.25%     
==========================================
  Files          26       27       +1     
  Lines        6545     6610      +65     
  Branches     1138     1138              
==========================================
+ Hits         2756     2800      +44     
- Misses       3542     3563      +21     
  Partials      247      247              
Flag Coverage Δ
Linux 42.34% <64.61%> (+0.25%) ⬆️
project 37.71% <ø> (ø)
py310 42.29% <64.61%> (+0.25%) ⬆️
py311 42.29% <64.61%> (+0.25%) ⬆️
py314 42.29% <64.61%> (+0.25%) ⬆️
salt_3006_27 42.29% <64.61%> (+0.25%) ⬆️
salt_3008_2 42.29% <64.61%> (+0.25%) ⬆️
tests 50.85% <64.61%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant