mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 03:15:36 +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)
|
||||
if err != nil {
|
||||
unexposePort(host)
|
||||
sendError(err)
|
||||
}
|
||||
go handleStopSignals(p)
|
||||
sendOK()
|
||||
p.Run()
|
||||
unexposePort(host)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@ -71,12 +69,3 @@ func exposePort(host net.Addr, port int) error {
|
||||
|
||||
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