diff options
author | Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> | 2021-03-02 17:01:25 +0900 |
---|---|---|
committer | Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> | 2021-03-02 17:01:25 +0900 |
commit | 2f0fc2911cc98d60ad0695411218bff30720a083 (patch) | |
tree | 6f70df48b8bcac6dac2ee4087c759771a3d4f132 /vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent | |
parent | 8af66806c8042501ca32e66efdeb463cf5346cab (diff) | |
download | podman-2f0fc2911cc98d60ad0695411218bff30720a083.tar.gz podman-2f0fc2911cc98d60ad0695411218bff30720a083.tar.bz2 podman-2f0fc2911cc98d60ad0695411218bff30720a083.zip |
Bump RootlessKit v0.14.0-beta.0
https://github.com/rootless-containers/rootlesskit/releases/tag/v0.14.0-beta.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Diffstat (limited to 'vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent')
3 files changed, 14 insertions, 5 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 f6e5e56ed..e7ce641e1 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 @@ -15,6 +15,7 @@ import ( "github.com/pkg/errors" + "github.com/rootless-containers/rootlesskit/pkg/api" "github.com/rootless-containers/rootlesskit/pkg/port" "github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg" "github.com/rootless-containers/rootlesskit/pkg/port/builtin/opaque" @@ -56,6 +57,14 @@ type driver struct { nextID int } +func (d *driver) Info(ctx context.Context) (*api.PortDriverInfo, error) { + info := &api.PortDriverInfo{ + Driver: "builtin", + Protos: []string{"tcp", "tcp4", "tcp6", "udp", "udp4", "udp6"}, + } + return info, nil +} + func (d *driver) OpaqueForChild() map[string]string { return map[string]string{ opaque.SocketPath: d.socketPath, @@ -134,9 +143,9 @@ func (d *driver) AddPort(ctx context.Context, spec port.Spec) (*port.Status, err return nil // FIXME } switch spec.Proto { - case "tcp": + case "tcp", "tcp4", "tcp6": err = tcp.Run(d.socketPath, spec, routineStopCh, d.logWriter) - case "udp": + case "udp", "udp4", "udp6": err = udp.Run(d.socketPath, spec, routineStopCh, d.logWriter) default: // NOTREACHED diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/tcp/tcp.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/tcp/tcp.go index 9fb801162..7a7a167f1 100644 --- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/tcp/tcp.go +++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/tcp/tcp.go @@ -13,7 +13,7 @@ import ( ) func Run(socketPath string, spec port.Spec, stopCh <-chan struct{}, logWriter io.Writer) error { - ln, err := net.Listen("tcp", net.JoinHostPort(spec.ParentIP, strconv.Itoa(spec.ParentPort))) + ln, err := net.Listen(spec.Proto, net.JoinHostPort(spec.ParentIP, strconv.Itoa(spec.ParentPort))) if err != nil { fmt.Fprintf(logWriter, "listen: %v\n", err) return err diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udp.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udp.go index fbff2b081..0080dd22c 100644 --- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udp.go +++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udp.go @@ -14,11 +14,11 @@ import ( ) func Run(socketPath string, spec port.Spec, stopCh <-chan struct{}, logWriter io.Writer) error { - addr, err := net.ResolveUDPAddr("udp", net.JoinHostPort(spec.ParentIP, strconv.Itoa(spec.ParentPort))) + addr, err := net.ResolveUDPAddr(spec.Proto, net.JoinHostPort(spec.ParentIP, strconv.Itoa(spec.ParentPort))) if err != nil { return err } - c, err := net.ListenUDP("udp", addr) + c, err := net.ListenUDP(spec.Proto, addr) if err != nil { return err } |