mirror of
https://github.com/containers/podman.git
synced 2025-11-13 17:47:13 +08:00
Vendor in containers/(storage,image, common, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
12
vendor/github.com/containers/common/libnetwork/cni/run.go
generated
vendored
12
vendor/github.com/containers/common/libnetwork/cni/run.go
generated
vendored
@@ -5,6 +5,7 @@ package cni
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -15,7 +16,6 @@ import (
|
||||
"github.com/containers/common/libnetwork/internal/util"
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ func (n *cniNetwork) Setup(namespacePath string, options types.SetupOptions) (ma
|
||||
|
||||
err = setupLoopback(namespacePath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to set the loopback adapter up")
|
||||
return nil, fmt.Errorf("failed to set the loopback adapter up: %w", err)
|
||||
}
|
||||
|
||||
var retErr error
|
||||
@@ -108,7 +108,7 @@ func CNIResultToStatus(res cnitypes.Result) (types.StatusBlock, error) {
|
||||
for _, nameserver := range cniResult.DNS.Nameservers {
|
||||
ip := net.ParseIP(nameserver)
|
||||
if ip == nil {
|
||||
return result, errors.Errorf("failed to parse cni nameserver ip %s", nameserver)
|
||||
return result, fmt.Errorf("failed to parse cni nameserver ip %s", nameserver)
|
||||
}
|
||||
nameservers = append(nameservers, ip)
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func CNIResultToStatus(res cnitypes.Result) (types.StatusBlock, error) {
|
||||
continue
|
||||
}
|
||||
if len(cniResult.Interfaces) <= *ip.Interface {
|
||||
return result, errors.Errorf("invalid cni result, interface index %d out of range", *ip.Interface)
|
||||
return result, fmt.Errorf("invalid cni result, interface index %d out of range", *ip.Interface)
|
||||
}
|
||||
|
||||
// when we have a ip for this interface add it to the subnets
|
||||
@@ -236,7 +236,7 @@ func (n *cniNetwork) teardown(namespacePath string, options types.TeardownOption
|
||||
logrus.Warnf("Failed to load cached network config: %v, falling back to loading network %s from disk", err, name)
|
||||
network := n.networks[name]
|
||||
if network == nil {
|
||||
multiErr = multierror.Append(multiErr, errors.Wrapf(types.ErrNoSuchNetwork, "network %s", name))
|
||||
multiErr = multierror.Append(multiErr, fmt.Errorf("network %s: %w", name, types.ErrNoSuchNetwork))
|
||||
continue
|
||||
}
|
||||
cniConfList = network.cniNet
|
||||
@@ -258,7 +258,7 @@ func getCachedNetworkConfig(cniConf *libcni.CNIConfig, name string, rt *libcni.R
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
} else if confBytes == nil {
|
||||
return nil, nil, errors.Errorf("network %s not found in CNI cache", name)
|
||||
return nil, nil, fmt.Errorf("network %s not found in CNI cache", name)
|
||||
}
|
||||
|
||||
cniConfList, err = libcni.ConfListFromBytes(confBytes)
|
||||
|
||||
Reference in New Issue
Block a user