fix: network-scoped alias is supported only for containers in user defined networks#2075
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Codecov Report
@@ Coverage Diff @@
## master #2075 +/- ##
==========================================
+ Coverage 61.22% 61.46% +0.24%
==========================================
Files 46 53 +7
Lines 7141 8780 +1639
==========================================
+ Hits 4372 5397 +1025
- Misses 2462 2955 +493
- Partials 307 428 +121
... and 2 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
|
Thanks for your work. I really need it |
|
This would solve |
I also ran into the issue that is fixed by this PR. Thank you for fixing it @ChristopherHX Please review and approve! @ALL |
network-scoped alias is supported only for containers in user defined networks Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This Windows only issue is caused by the missing
!n.IsHost()in then.IsUserDefined()function for windows. Act sends the network alias for the host network on windows, linux sees that and calls the sameIsUserDefined(but uses the unix definition on the server side), which detects thehostnetwork as non user defined network.On linux and macOS it is impossible to reproduce at the time of creating this change. I don't get why windows has it's own definition, but bad maintained.
The actual code uses
IsUserDefinedto detect if network aliases are supported, which didn't work on windows due to the mess in the docker client go library.Thank you docker client.
go\pkg\mod\github.com\docker\docker@v24.0.7+incompatible\api\types\container\hostconfig_unix.go
go\pkg\mod\github.com\docker\docker@v24.0.7+incompatible\api\types\container\hostconfig_windows.go
Why did docker this?
Seems like we have to replace the convenience function with it's unix definition
Important bug fix, I don't have the power