1
0
Fork 0

Do not warn network missing if connected to a container network

This commit is contained in:
Patrick Evans 2025-05-19 07:26:09 +00:00 committed by GitHub
parent 9ee0e43eac
commit 79fde2b6dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,7 +340,6 @@ func (p *DynConfBuilder) getIPAddress(ctx context.Context, container dockerData)
}
netNotFound = true
logger.Warn().Msgf("Could not find network named %q for container %q. Maybe you're missing the project's prefix in the label?", container.ExtraConf.Network, container.Name)
}
}
@ -382,6 +381,9 @@ func (p *DynConfBuilder) getIPAddress(ctx context.Context, container dockerData)
return p.getIPAddress(ctx, containerParsed)
}
if netNotFound {
logger.Warn().Msgf("Could not find network named %q for container %q. Maybe you're missing the project's prefix in the label?", container.ExtraConf.Network, container.Name)
}
for _, network := range container.NetworkSettings.Networks {
if netNotFound {
logger.Warn().Msgf("Defaulting to first available network (%q) for container %q.", network, container.Name)