feat(container): add UpdatePorts method and support for host network mode

This commit is contained in:
yusing
2025-05-06 20:27:25 +08:00
parent 9eb674029e
commit c90ec8caa1
2 changed files with 44 additions and 8 deletions

View File

@@ -75,6 +75,14 @@ func (p *DockerProvider) loadRoutesImpl() (route.Routes, gperr.Error) {
continue
}
if container.IsHostNetworkMode {
err := container.UpdatePorts()
if err != nil {
errs.Add(gperr.PrependSubject(container.ContainerName, err))
continue
}
}
newEntries, err := p.routesFromContainerLabels(container)
if err != nil {
errs.Add(err.Subject(container.ContainerName))