Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@robmry
Copy link
Contributor

@robmry robmry commented Jan 30, 2025

- What I did

Commit 38e76eb (Ask network drivers if they'll use a gateway address) added an optional driver interface "GwAllocChecker" to give the driver a chance to say whether, given network config options, it would use a gateway address if one was reserved for it in IPAM.

So, implement support for that in the remote network driver.

- How I did it

The remote driver itself implements the interface, but only tries to make an HTTP request to the driver plugin if the plugin has reported support for it in response to an initial capabilities request.

- How to verify it

New test.

- Description for the changelog

- If a custom network driver reports capability `GwAllocChecker` then, before a network is created, it will get
  a `GwAllocCheckerRequest` with the network's options. The custom driver may then reply that no gateway
  IP address should be allocated.

@robmry robmry added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny area/networking Networking impact/changelog impact/documentation labels Jan 30, 2025
@robmry robmry added this to the 28.0.0 milestone Jan 30, 2025
@robmry robmry self-assigned this Jan 30, 2025
@robmry robmry marked this pull request as ready for review January 30, 2025 18:40
@robmry robmry requested a review from akerouanton January 30, 2025 18:41
@thaJeztah
Copy link
Member

/cc @aepifanov

Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM but /libnetwork/docs/remote.md needs to be updated

Commit 38e76eb (Ask network drivers if they'll use a gateway
address) added an optional driver interface "GwAllocChecker"
to give the driver a chance to say whether, given network
config options, it would use a gateway address if one was
reserved for it in IPAM.

So, implement support for that in the remote network driver.
The driver itself implements the interface, but only tries
to make an HTTP request to the driver plugin if the plugin
has reported support for it in response to an initial
capabilities request.

Signed-off-by: Rob Murray <[email protected]>
@robmry robmry force-pushed the remote_driver_skip_gw_alloc branch from cd05dc9 to 6349514 Compare February 4, 2025 19:36
@robmry
Copy link
Contributor Author

robmry commented Feb 4, 2025

Code LGTM but /libnetwork/docs/remote.md needs to be updated

Ah - yes! Thank you, I've added some words.

@robmry robmry merged commit 997a6e1 into moby:master Feb 5, 2025
150 checks passed
@robmry robmry deleted the remote_driver_skip_gw_alloc branch February 26, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking Networking impact/changelog impact/documentation kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for networks without gateway

4 participants