Skip to content

Commit

Permalink
adjust the fix for #13371 to conform to code elsewhere in the file an…
Browse files Browse the repository at this point in the history
…d check for IPAM
  • Loading branch information
tomjn authored Mar 28, 2024
1 parent 5a191b3 commit ad92256
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/providers/docker/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ def network_defined?(subnet_string)

network_info = inspect_network(all_networks)
network_info.each do |network|
config = Array(network["IPAM"]["Config"])
if ( config &&
config.size > 0 &&
config.first["Subnet"] == subnet_string)
next if !network["IPAM"]
config = network["IPAM"]["Config"]
next if !config || config.size < 1
if (config.first["Subnet"] == subnet_string)
@logger.debug("Found existing network #{network["Name"]} already configured with #{subnet_string}")
return network["Name"]
end
Expand Down

0 comments on commit ad92256

Please sign in to comment.