summaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-11-19 14:25:58 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-11-19 14:26:03 -0500
commit44b240470270021e2680afe9de62e5096067a1bf (patch)
treeeae48e206f340a2695b1f54582fb3b28fc7cad2d /vendor/github.com
parent2755d0255c94ac2ef797636935f83e3351d4d5af (diff)
downloadpodman-44b240470270021e2680afe9de62e5096067a1bf.tar.gz
podman-44b240470270021e2680afe9de62e5096067a1bf.tar.bz2
podman-44b240470270021e2680afe9de62e5096067a1bf.zip
Bump github.com/rootless-containers/rootlesskit from 0.14.5 to 0.14.6
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.14.5 to 0.14.6. - [Release notes](https://github.com/rootless-containers/rootlesskit/releases) - [Commits](rootless-containers/rootlesskit@v0.14.5...v0.14.6) --- updated-dependencies: - dependency-name: github.com/rootless-containers/rootlesskit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/moby/sys/mountinfo/go.mod4
-rw-r--r--vendor/github.com/moby/sys/mountinfo/go.sum4
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mounted_linux.go11
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mounted_unix.go16
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mountinfo.go9
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go9
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go27
-rw-r--r--vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go3
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/msgutil/msgutil.go13
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/child/child.go12
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg/msg.go9
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/parent.go18
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udp.go5
-rw-r--r--vendor/github.com/rootless-containers/rootlesskit/pkg/port/portutil/portutil.go31
14 files changed, 77 insertions, 94 deletions
diff --git a/vendor/github.com/moby/sys/mountinfo/go.mod b/vendor/github.com/moby/sys/mountinfo/go.mod
index 9749ea96d..1cc3efcf7 100644
--- a/vendor/github.com/moby/sys/mountinfo/go.mod
+++ b/vendor/github.com/moby/sys/mountinfo/go.mod
@@ -1,5 +1,5 @@
module github.com/moby/sys/mountinfo
-go 1.14
+go 1.16
-require golang.org/x/sys v0.0.0-20200909081042-eff7692f9009
+require golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
diff --git a/vendor/github.com/moby/sys/mountinfo/go.sum b/vendor/github.com/moby/sys/mountinfo/go.sum
index 2a5be7ea8..c257a6a29 100644
--- a/vendor/github.com/moby/sys/mountinfo/go.sum
+++ b/vendor/github.com/moby/sys/mountinfo/go.sum
@@ -1,2 +1,2 @@
-golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM=
-golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik=
+golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/vendor/github.com/moby/sys/mountinfo/mounted_linux.go b/vendor/github.com/moby/sys/mountinfo/mounted_linux.go
index bc9f6b2ad..5c9e3e30e 100644
--- a/vendor/github.com/moby/sys/mountinfo/mounted_linux.go
+++ b/vendor/github.com/moby/sys/mountinfo/mounted_linux.go
@@ -16,9 +16,6 @@ func mountedByOpenat2(path string) (bool, error) {
Flags: unix.O_PATH | unix.O_CLOEXEC,
})
if err != nil {
- if err == unix.ENOENT { // not a mount
- return false, nil
- }
return false, &os.PathError{Op: "openat2", Path: dir, Err: err}
}
fd, err := unix.Openat2(dirfd, last, &unix.OpenHow{
@@ -26,20 +23,22 @@ func mountedByOpenat2(path string) (bool, error) {
Resolve: unix.RESOLVE_NO_XDEV,
})
_ = unix.Close(dirfd)
- switch err {
+ switch err { //nolint:errorlint // unix errors are bare
case nil: // definitely not a mount
_ = unix.Close(fd)
return false, nil
case unix.EXDEV: // definitely a mount
return true, nil
- case unix.ENOENT: // not a mount
- return false, nil
}
// not sure
return false, &os.PathError{Op: "openat2", Path: path, Err: err}
}
func mounted(path string) (bool, error) {
+ path, err := normalizePath(path)
+ if err != nil {
+ return false, err
+ }
// Try a fast path, using openat2() with RESOLVE_NO_XDEV.
mounted, err := mountedByOpenat2(path)
if err == nil {
diff --git a/vendor/github.com/moby/sys/mountinfo/mounted_unix.go b/vendor/github.com/moby/sys/mountinfo/mounted_unix.go
index efb03978b..45ddad236 100644
--- a/vendor/github.com/moby/sys/mountinfo/mounted_unix.go
+++ b/vendor/github.com/moby/sys/mountinfo/mounted_unix.go
@@ -1,9 +1,9 @@
-// +build linux freebsd,cgo openbsd,cgo
+//go:build linux || (freebsd && cgo) || (openbsd && cgo) || (darwin && cgo)
+// +build linux freebsd,cgo openbsd,cgo darwin,cgo
package mountinfo
import (
- "errors"
"fmt"
"os"
"path/filepath"
@@ -15,10 +15,6 @@ func mountedByStat(path string) (bool, error) {
var st unix.Stat_t
if err := unix.Lstat(path, &st); err != nil {
- if err == unix.ENOENT {
- // Treat ENOENT as "not mounted".
- return false, nil
- }
return false, &os.PathError{Op: "stat", Path: path, Err: err}
}
dev := st.Dev
@@ -49,14 +45,6 @@ func normalizePath(path string) (realPath string, err error) {
}
func mountedByMountinfo(path string) (bool, error) {
- path, err := normalizePath(path)
- if err != nil {
- if errors.Is(err, unix.ENOENT) {
- // treat ENOENT as "not mounted"
- return false, nil
- }
- return false, err
- }
entries, err := GetMounts(SingleEntryFilter(path))
if err != nil {
return false, err
diff --git a/vendor/github.com/moby/sys/mountinfo/mountinfo.go b/vendor/github.com/moby/sys/mountinfo/mountinfo.go
index 403a89331..9867a66dd 100644
--- a/vendor/github.com/moby/sys/mountinfo/mountinfo.go
+++ b/vendor/github.com/moby/sys/mountinfo/mountinfo.go
@@ -10,11 +10,12 @@ func GetMounts(f FilterFunc) ([]*Info, error) {
return parseMountTable(f)
}
-// Mounted determines if a specified path is a mount point.
+// Mounted determines if a specified path is a mount point. In case of any
+// error, false (and an error) is returned.
//
-// The argument must be an absolute path, with all symlinks resolved, and clean.
-// One way to ensure it is to process the path using filepath.Abs followed by
-// filepath.EvalSymlinks before calling this function.
+// The non-existent path returns an error. If a caller is not interested
+// in this particular error, it should handle it separately using e.g.
+// errors.Is(err, os.ErrNotExist).
func Mounted(path string) (bool, error) {
// root is always mounted
if path == string(os.PathSeparator) {
diff --git a/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go b/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
index b1c12d02b..d5513a26d 100644
--- a/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
+++ b/vendor/github.com/moby/sys/mountinfo/mountinfo_bsd.go
@@ -1,4 +1,5 @@
-// +build freebsd,cgo openbsd,cgo
+//go:build (freebsd && cgo) || (openbsd && cgo) || (darwin && cgo)
+// +build freebsd,cgo openbsd,cgo darwin,cgo
package mountinfo
@@ -21,7 +22,7 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT))
if count == 0 {
- return nil, fmt.Errorf("Failed to call getmntinfo")
+ return nil, fmt.Errorf("failed to call getmntinfo")
}
var entries []C.struct_statfs
@@ -55,6 +56,10 @@ func parseMountTable(filter FilterFunc) ([]*Info, error) {
}
func mounted(path string) (bool, error) {
+ path, err := normalizePath(path)
+ if err != nil {
+ return false, err
+ }
// Fast path: compare st.st_dev fields.
// This should always work for FreeBSD and OpenBSD.
mounted, err := mountedByStat(path)
diff --git a/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go b/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
index f09a70fa0..59332b07b 100644
--- a/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
+++ b/vendor/github.com/moby/sys/mountinfo/mountinfo_linux.go
@@ -52,7 +52,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
numFields := len(fields)
if numFields < 10 {
// should be at least 10 fields
- return nil, fmt.Errorf("Parsing '%s' failed: not enough fields (%d)", text, numFields)
+ return nil, fmt.Errorf("parsing '%s' failed: not enough fields (%d)", text, numFields)
}
// separator field
@@ -67,7 +67,7 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
for fields[sepIdx] != "-" {
sepIdx--
if sepIdx == 5 {
- return nil, fmt.Errorf("Parsing '%s' failed: missing - separator", text)
+ return nil, fmt.Errorf("parsing '%s' failed: missing - separator", text)
}
}
@@ -75,46 +75,39 @@ func GetMountsFromReader(r io.Reader, filter FilterFunc) ([]*Info, error) {
p.Mountpoint, err = unescape(fields[4])
if err != nil {
- return nil, fmt.Errorf("Parsing '%s' failed: mount point: %w", fields[4], err)
+ return nil, fmt.Errorf("parsing '%s' failed: mount point: %w", fields[4], err)
}
p.FSType, err = unescape(fields[sepIdx+1])
if err != nil {
- return nil, fmt.Errorf("Parsing '%s' failed: fstype: %w", fields[sepIdx+1], err)
+ return nil, fmt.Errorf("parsing '%s' failed: fstype: %w", fields[sepIdx+1], err)
}
p.Source, err = unescape(fields[sepIdx+2])
if err != nil {
- return nil, fmt.Errorf("Parsing '%s' failed: source: %w", fields[sepIdx+2], err)
+ return nil, fmt.Errorf("parsing '%s' failed: source: %w", fields[sepIdx+2], err)
}
p.VFSOptions = fields[sepIdx+3]
// ignore any numbers parsing errors, as there should not be any
p.ID, _ = strconv.Atoi(fields[0])
p.Parent, _ = strconv.Atoi(fields[1])
- mm := strings.Split(fields[2], ":")
+ mm := strings.SplitN(fields[2], ":", 3)
if len(mm) != 2 {
- return nil, fmt.Errorf("Parsing '%s' failed: unexpected minor:major pair %s", text, mm)
+ return nil, fmt.Errorf("parsing '%s' failed: unexpected major:minor pair %s", text, mm)
}
p.Major, _ = strconv.Atoi(mm[0])
p.Minor, _ = strconv.Atoi(mm[1])
p.Root, err = unescape(fields[3])
if err != nil {
- return nil, fmt.Errorf("Parsing '%s' failed: root: %w", fields[3], err)
+ return nil, fmt.Errorf("parsing '%s' failed: root: %w", fields[3], err)
}
p.Options = fields[5]
// zero or more optional fields
- switch {
- case sepIdx == 6:
- // zero, do nothing
- case sepIdx == 7:
- p.Optional = fields[6]
- default:
- p.Optional = strings.Join(fields[6:sepIdx-1], " ")
- }
+ p.Optional = strings.Join(fields[6:sepIdx], " ")
- // Run the filter after parsing all of the fields.
+ // Run the filter after parsing all fields.
var skip, stop bool
if filter != nil {
skip, stop = filter(p)
diff --git a/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go b/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
index d33ebca09..95769a76d 100644
--- a/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
+++ b/vendor/github.com/moby/sys/mountinfo/mountinfo_unsupported.go
@@ -1,4 +1,5 @@
-// +build !windows,!linux,!freebsd,!openbsd freebsd,!cgo openbsd,!cgo
+//go:build (!windows && !linux && !freebsd && !openbsd && !darwin) || (freebsd && !cgo) || (openbsd && !cgo) || (darwin && !cgo)
+// +build !windows,!linux,!freebsd,!openbsd,!darwin freebsd,!cgo openbsd,!cgo darwin,!cgo
package mountinfo
diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/msgutil/msgutil.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/msgutil/msgutil.go
index a0a0c94c6..74caa9a49 100644
--- a/vendor/github.com/rootless-containers/rootlesskit/pkg/msgutil/msgutil.go
+++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/msgutil/msgutil.go
@@ -5,9 +5,8 @@ import (
"bytes"
"encoding/binary"
"encoding/json"
+ "fmt"
"io"
-
- "github.com/pkg/errors"
)
const (
@@ -20,7 +19,7 @@ func MarshalToWriter(w io.Writer, x interface{}) (int, error) {
return 0, err
}
if len(b) > maxLength {
- return 0, errors.Errorf("bad message length: %d (max: %d)", len(b), maxLength)
+ return 0, fmt.Errorf("bad message length: %d (max: %d)", len(b), maxLength)
}
h := make([]byte, 4)
binary.LittleEndian.PutUint32(h, uint32(len(b)))
@@ -34,11 +33,11 @@ func UnmarshalFromReader(r io.Reader, x interface{}) (int, error) {
return n, err
}
if n != 4 {
- return n, errors.Errorf("read %d bytes, expected 4 bytes", n)
+ return n, fmt.Errorf("read %d bytes, expected 4 bytes", n)
}
bLen := binary.LittleEndian.Uint32(hdr)
if bLen > maxLength || bLen < 1 {
- return n, errors.Errorf("bad message length: %d (max: %d)", bLen, maxLength)
+ return n, fmt.Errorf("bad message length: %d (max: %d)", bLen, maxLength)
}
b := make([]byte, bLen)
n, err = r.Read(b)
@@ -46,7 +45,7 @@ func UnmarshalFromReader(r io.Reader, x interface{}) (int, error) {
return 4 + n, err
}
if n != int(bLen) {
- return 4 + n, errors.Errorf("read %d bytes, expected %d bytes", n, bLen)
+ return 4 + n, fmt.Errorf("read %d bytes, expected %d bytes", n, bLen)
}
return 4 + n, json.Unmarshal(b, x)
}
@@ -60,7 +59,7 @@ func Marshal(x interface{}) ([]byte, error) {
func Unmarshal(b []byte, x interface{}) error {
n, err := UnmarshalFromReader(bytes.NewReader(b), x)
if n != len(b) {
- return errors.Errorf("read %d bytes, expected %d bytes", n, len(b))
+ return fmt.Errorf("read %d bytes, expected %d bytes", n, len(b))
}
return err
}
diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/child/child.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/child/child.go
index 05dc0303c..5d1f33f08 100644
--- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/child/child.go
+++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/child/child.go
@@ -1,13 +1,14 @@
package child
import (
+ "errors"
+ "fmt"
"io"
"net"
"os"
"strconv"
"strings"
- "github.com/pkg/errors"
"golang.org/x/sys/unix"
"github.com/rootless-containers/rootlesskit/pkg/msgutil"
@@ -76,7 +77,6 @@ func (d *childDriver) RunChildDriver(opaque map[string]string, quit <-chan struc
c.Close()
}()
}
- return nil
}
func (d *childDriver) routine(c *net.UnixConn) error {
@@ -90,7 +90,7 @@ func (d *childDriver) routine(c *net.UnixConn) error {
case msg.RequestTypeConnect:
return d.handleConnectRequest(c, &req)
default:
- return errors.Errorf("unknown request type %q", req.Type)
+ return fmt.Errorf("unknown request type %q", req.Type)
}
}
@@ -108,7 +108,7 @@ func (d *childDriver) handleConnectRequest(c *net.UnixConn, req *msg.Request) er
case "udp4":
case "udp6":
default:
- return errors.Errorf("unknown proto: %q", req.Proto)
+ return fmt.Errorf("unknown proto: %q", req.Proto)
}
// dialProto does not need "4", "6" suffix
dialProto := strings.TrimSuffix(strings.TrimSuffix(req.Proto, "6"), "4")
@@ -119,7 +119,7 @@ func (d *childDriver) handleConnectRequest(c *net.UnixConn, req *msg.Request) er
} else {
p := net.ParseIP(ip)
if p == nil {
- return errors.Errorf("invalid IP: %q", ip)
+ return fmt.Errorf("invalid IP: %q", ip)
}
ip = p.String()
}
@@ -130,7 +130,7 @@ func (d *childDriver) handleConnectRequest(c *net.UnixConn, req *msg.Request) er
defer targetConn.Close() // no effect on duplicated FD
targetConnFiler, ok := targetConn.(filer)
if !ok {
- return errors.Errorf("unknown target connection: %+v", targetConn)
+ return fmt.Errorf("unknown target connection: %+v", targetConn)
}
targetConnFile, err := targetConnFiler.File()
if err != nil {
diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg/msg.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg/msg.go
index a60d99bd9..31080609a 100644
--- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg/msg.go
+++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg/msg.go
@@ -1,10 +1,11 @@
package msg
import (
+ "errors"
+ "fmt"
"net"
"time"
- "github.com/pkg/errors"
"golang.org/x/sys/unix"
"github.com/rootless-containers/rootlesskit/pkg/msgutil"
@@ -78,7 +79,7 @@ func ConnectToChild(c *net.UnixConn, spec port.Spec) (int, error) {
return 0, err
}
if oobN != oobSpace {
- return 0, errors.Errorf("expected OOB space %d, got %d", oobSpace, oobN)
+ return 0, fmt.Errorf("expected OOB space %d, got %d", oobSpace, oobN)
}
oob = oob[:oobN]
fd, err := parseFDFromOOB(oob)
@@ -126,7 +127,7 @@ func parseFDFromOOB(oob []byte) (int, error) {
return 0, err
}
if len(scms) != 1 {
- return 0, errors.Errorf("unexpected scms: %v", scms)
+ return 0, fmt.Errorf("unexpected scms: %v", scms)
}
scm := scms[0]
fds, err := unix.ParseUnixRights(&scm)
@@ -134,7 +135,7 @@ func parseFDFromOOB(oob []byte) (int, error) {
return 0, err
}
if len(fds) != 1 {
- return 0, errors.Errorf("unexpected fds: %v", fds)
+ return 0, fmt.Errorf("unexpected fds: %v", fds)
}
return fds[0], nil
}
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 c6eecc826..1c53e26a6 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
@@ -2,9 +2,9 @@ package parent
import (
"context"
+ "errors"
"fmt"
"io"
- "io/ioutil"
"net"
"os"
"path/filepath"
@@ -14,8 +14,6 @@ import (
"syscall"
"time"
- "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"
@@ -32,10 +30,10 @@ func NewDriver(logWriter io.Writer, stateDir string) (port.ParentDriver, error)
childReadyPipePath := filepath.Join(stateDir, ".bp-ready.pipe")
// remove the path just in case the previous rootlesskit instance crashed
if err := os.RemoveAll(childReadyPipePath); err != nil {
- return nil, errors.Wrapf(err, "cannot remove %s", childReadyPipePath)
+ return nil, fmt.Errorf("cannot remove %s: %w", childReadyPipePath, err)
}
if err := syscall.Mkfifo(childReadyPipePath, 0600); err != nil {
- return nil, errors.Wrapf(err, "cannot mkfifo %s", childReadyPipePath)
+ return nil, fmt.Errorf("cannot mkfifo %s: %w", childReadyPipePath, err)
}
d := driver{
logWriter: logWriter,
@@ -79,7 +77,7 @@ func (d *driver) RunParentDriver(initComplete chan struct{}, quit <-chan struct{
if err != nil {
return err
}
- if _, err = ioutil.ReadAll(childReadyPipeR); err != nil {
+ if _, err = io.ReadAll(childReadyPipeR); err != nil {
return err
}
childReadyPipeR.Close()
@@ -110,7 +108,7 @@ func annotateEPERM(origErr error, spec port.Spec) error {
// Read "net.ipv4.ip_unprivileged_port_start" value (typically 1024)
// TODO: what for IPv6?
// NOTE: sync.Once should not be used here
- b, e := ioutil.ReadFile("/proc/sys/net/ipv4/ip_unprivileged_port_start")
+ b, e := os.ReadFile("/proc/sys/net/ipv4/ip_unprivileged_port_start")
if e != nil {
return origErr
}
@@ -129,7 +127,7 @@ func annotateEPERM(origErr error, spec port.Spec) error {
text += ", or set CAP_NET_BIND_SERVICE on rootlesskit binary"
}
text += fmt.Sprintf(", or choose a larger port number (>= %d)", start)
- return errors.Wrap(origErr, text)
+ return fmt.Errorf(text+": %w", origErr)
}
func (d *driver) AddPort(ctx context.Context, spec port.Spec) (*port.Status, error) {
@@ -152,7 +150,7 @@ func (d *driver) AddPort(ctx context.Context, spec port.Spec) (*port.Status, err
}
return errors.New("routineStoppedCh was closed without sending data?")
case <-ctx.Done():
- return errors.Wrap(err, "timed out while waiting for routineStoppedCh after closing routineStopCh")
+ return fmt.Errorf("timed out while waiting for routineStoppedCh after closing routineStopCh: %w", err)
}
}
switch spec.Proto {
@@ -198,7 +196,7 @@ func (d *driver) RemovePort(ctx context.Context, id int) error {
defer d.mu.Unlock()
stop, ok := d.stoppers[id]
if !ok {
- return errors.Errorf("unknown id: %d", id)
+ return fmt.Errorf("unknown id: %d", id)
}
if _, ok := ctx.Deadline(); !ok {
var cancel context.CancelFunc
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 67062117a..47f3a6461 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
@@ -1,13 +1,12 @@
package udp
import (
+ "fmt"
"io"
"net"
"os"
"strconv"
- "github.com/pkg/errors"
-
"github.com/rootless-containers/rootlesskit/pkg/port"
"github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg"
"github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp/udpproxy"
@@ -39,7 +38,7 @@ func Run(socketPath string, spec port.Spec, stopCh <-chan struct{}, stoppedCh ch
}
uc, ok := fc.(*net.UDPConn)
if !ok {
- return nil, errors.Errorf("file conn doesn't implement *net.UDPConn: %+v", fc)
+ return nil, fmt.Errorf("file conn doesn't implement *net.UDPConn: %+v", fc)
}
return uc, nil
},
diff --git a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/portutil/portutil.go b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/portutil/portutil.go
index 937932642..a1e649ab7 100644
--- a/vendor/github.com/rootless-containers/rootlesskit/pkg/port/portutil/portutil.go
+++ b/vendor/github.com/rootless-containers/rootlesskit/pkg/port/portutil/portutil.go
@@ -1,13 +1,12 @@
package portutil
import (
+ "fmt"
"net"
"strconv"
"strings"
"text/scanner"
- "github.com/pkg/errors"
-
"github.com/rootless-containers/rootlesskit/pkg/port"
)
@@ -49,18 +48,18 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
// Get the proto
protoPos := strings.LastIndex(portSpec, "/")
if protoPos < 0 {
- return nil, errors.Errorf("missing proto in PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("missing proto in PortSpec string: %q", portSpec)
}
parts[proto] = portSpec[protoPos+1:]
err = validateProto(parts[proto])
if err != nil {
- return nil, errors.Wrapf(err, "invalid PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("invalid PortSpec string: %q: %w", portSpec, err)
}
// Get the parent port
portPos := strings.LastIndex(portSpec, ":")
if portPos < 0 {
- return nil, errors.Errorf("unexpected PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected PortSpec string: %q", portSpec)
}
parts[childPort] = portSpec[portPos+1 : protoPos]
@@ -69,7 +68,7 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
for tok := s.Scan(); tok != scanner.EOF; tok = s.Scan() {
if index > childPort {
- return nil, errors.Errorf("unexpected PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected PortSpec string: %q", portSpec)
}
switch tok {
@@ -92,10 +91,10 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
}
if parts[parentIP] != "" && net.ParseIP(parts[parentIP]) == nil {
- return nil, errors.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
}
if parts[childIP] != "" && net.ParseIP(parts[childIP]) == nil {
- return nil, errors.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected ParentIP in PortSpec string: %q", portSpec)
}
ps := &port.Spec{
@@ -106,12 +105,12 @@ func ParsePortSpec(portSpec string) (*port.Spec, error) {
ps.ParentPort, err = strconv.Atoi(parts[parentPort])
if err != nil {
- return nil, errors.Wrapf(err, "unexpected ChildPort in PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected ChildPort in PortSpec string: %q: %w", portSpec, err)
}
ps.ChildPort, err = strconv.Atoi(parts[childPort])
if err != nil {
- return nil, errors.Wrapf(err, "unexpected ParentPort in PortSpec string: %q", portSpec)
+ return nil, fmt.Errorf("unexpected ParentPort in PortSpec string: %q: %w", portSpec, err)
}
return ps, nil
@@ -125,26 +124,26 @@ func ValidatePortSpec(spec port.Spec, existingPorts map[int]*port.Status) error
}
if spec.ParentIP != "" {
if net.ParseIP(spec.ParentIP) == nil {
- return errors.Errorf("invalid ParentIP: %q", spec.ParentIP)
+ return fmt.Errorf("invalid ParentIP: %q", spec.ParentIP)
}
}
if spec.ChildIP != "" {
if net.ParseIP(spec.ChildIP) == nil {
- return errors.Errorf("invalid ChildIP: %q", spec.ChildIP)
+ return fmt.Errorf("invalid ChildIP: %q", spec.ChildIP)
}
}
if spec.ParentPort <= 0 || spec.ParentPort > 65535 {
- return errors.Errorf("invalid ParentPort: %q", spec.ParentPort)
+ return fmt.Errorf("invalid ParentPort: %q", spec.ParentPort)
}
if spec.ChildPort <= 0 || spec.ChildPort > 65535 {
- return errors.Errorf("invalid ChildPort: %q", spec.ChildPort)
+ return fmt.Errorf("invalid ChildPort: %q", spec.ChildPort)
}
for id, p := range existingPorts {
sp := p.Spec
sameProto := sp.Proto == spec.Proto
sameParent := sp.ParentIP == spec.ParentIP && sp.ParentPort == spec.ParentPort
if sameProto && sameParent {
- return errors.Errorf("conflict with ID %d", id)
+ return fmt.Errorf("conflict with ID %d", id)
}
}
return nil
@@ -158,6 +157,6 @@ func validateProto(proto string) error {
"sctp", "sctp4", "sctp6":
return nil
default:
- return errors.Errorf("unknown proto: %q", proto)
+ return fmt.Errorf("unknown proto: %q", proto)
}
}