Merge pull request #50961 from robmry/windows_hns_network_name

Windows containers: report HNS network name in inspect
This commit is contained in:
Sebastiaan van Stijn
2025-09-16 14:39:37 +02:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -266,7 +266,7 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand
ipamDriver, ipamOptions, v4Conf, v6Conf := v.IpamConfig()
netOption := map[string]string{}
for k, v := range v.DriverOptions() {
if k != winlibnetwork.NetworkName && k != winlibnetwork.HNSID {
if k != winlibnetwork.HNSID {
netOption[k] = v
}
}
@@ -349,7 +349,6 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand
if n.Scope() == scope.Global {
continue
}
v.Name = n.Name()
ipamDriver, ipamOptions, _, _ = n.IpamConfig()
// This will not cause network delete from HNS as the network
@@ -394,6 +393,9 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand
}
name := v.Name
if n != nil {
name = n.Name()
}
// If there is no nat network create one from the first NAT network
// encountered if it doesn't already exist

View File

@@ -422,6 +422,7 @@ func (d *driver) CreateNetwork(ctx context.Context, id string, option map[string
config.HnsID = hnsresponse.Id
genData[HNSID] = config.HnsID
genData[NetworkName] = network.Name
n.created = true
defer func() {