summaryrefslogtreecommitdiff
path: root/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go')
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go
index 2895a8f07..abd2c5e2c 100644
--- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go
+++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go
@@ -12,6 +12,7 @@ import (
"strings"
"sync"
"syscall"
+ "time"
"github.com/pkg/errors"
@@ -140,8 +141,13 @@ func (d *driver) AddPort(ctx context.Context, spec port.Spec) (*port.Status, err
}
routineStopCh := make(chan struct{})
routineStop := func() error {
- close(routineStopCh)
- return nil // FIXME
+ routineStopCh <- struct{}{}
+ select {
+ case <-routineStopCh:
+ case <-time.After(5 * time.Second):
+ return errors.New("stop timeout after 5 seconds")
+ }
+ return nil
}
switch spec.Proto {
case "tcp", "tcp4", "tcp6":