mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 04:03:11 +00:00
proxy: we don't need to explicitly unexposePort any more
The port will be automatically removed when the fd/fid is closed by a process exit/crash, or by a hypervisor crash. Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
e4f405be26
commit
b0c4fdae37
@ -20,13 +20,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
p, err := libproxy.NewProxy(host, container)
|
p, err := libproxy.NewProxy(host, container)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
unexposePort(host)
|
|
||||||
sendError(err)
|
sendError(err)
|
||||||
}
|
}
|
||||||
go handleStopSignals(p)
|
go handleStopSignals(p)
|
||||||
sendOK()
|
sendOK()
|
||||||
p.Run()
|
p.Run()
|
||||||
unexposePort(host)
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,12 +69,3 @@ func exposePort(host net.Addr, port int) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func unexposePort(host net.Addr) {
|
|
||||||
name := host.String()
|
|
||||||
log.Printf("unexposePort %s\n", name)
|
|
||||||
err := os.Remove("/port/" + name)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("Failed to remove /port/%s: %#v\n", name, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user