Skip to content

Commit

Permalink
domain/networks_manager.py: use specified driver in IPAMConfig
Browse files Browse the repository at this point in the history
When user specifies a IPAM driver through IPAMConfig, the driver value was
ignored and not translated to json used in network create command. This
patch fixes the issue by translating the IPAM driver configuration in
network_create json data.

Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka committed Sep 18, 2024
1 parent c68abf5 commit 86fbf29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions podman/domain/networks_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def create(self, name: str, **kwargs) -> Network:
return self.prepare_model(attrs=response.json())

def _prepare_ipam(self, data: Dict[str, Any], ipam: Dict[str, Any]):
if "Driver" in ipam:
data["ipam_options"] = {"driver": ipam["Driver"]}

if "Config" not in ipam:
return

Expand Down

0 comments on commit 86fbf29

Please sign in to comment.