summaryrefslogtreecommitdiff
path: root/vendor/github.com/containernetworking/cni/pkg/types/types.go
diff options
context:
space:
mode:
authorJakub Filak <jakub.filak@sap.com>2019-09-24 21:45:48 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-11-06 16:22:18 +0100
commit455f5b76169515dcc36cf4d7c1d51ead3be02e1f (patch)
tree212ae930aa545132929a3ae2ded94009110a6485 /vendor/github.com/containernetworking/cni/pkg/types/types.go
parent16cb2b38a8a645039bc4e2e9443cde777d90537f (diff)
downloadpodman-455f5b76169515dcc36cf4d7c1d51ead3be02e1f.tar.gz
podman-455f5b76169515dcc36cf4d7c1d51ead3be02e1f.tar.bz2
podman-455f5b76169515dcc36cf4d7c1d51ead3be02e1f.zip
vendor: updated ocicni for MAC address
`go get github.com/cri-o/ocicni@deac903fd99b6c52d781c9f42b8db3af7dcfd00a` I had to fix compilation errors in libpod/networking_linux.go --- ocicni.Networks has changed from string to the structure NetAttachment with the member Name (the former string value) and the member Ifname (optional). I don't think we can make use of Ifname here, so I just map the array of structures to array of strings - e.g. dropping Ifname. --- The function GetPodNetworkStatus no longer returns Result but it returns the wrapper structure NetResult which contains the former Result plus NetAttachment (Network name and Interface name). Again, I don't think we can make use of that information here, so I just added `.Result` to fix the build. --- Issue: #1136 Signed-off-by: Jakub Filak <jakub.filak@sap.com>
Diffstat (limited to 'vendor/github.com/containernetworking/cni/pkg/types/types.go')
-rw-r--r--vendor/github.com/containernetworking/cni/pkg/types/types.go25
1 files changed, 18 insertions, 7 deletions
diff --git a/vendor/github.com/containernetworking/cni/pkg/types/types.go b/vendor/github.com/containernetworking/cni/pkg/types/types.go
index d0d11006a..3e185c1ce 100644
--- a/vendor/github.com/containernetworking/cni/pkg/types/types.go
+++ b/vendor/github.com/containernetworking/cni/pkg/types/types.go
@@ -16,7 +16,6 @@ package types
import (
"encoding/json"
- "errors"
"fmt"
"io"
"net"
@@ -134,9 +133,16 @@ func (r *Route) String() string {
// Well known error codes
// see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes
const (
- ErrUnknown uint = iota // 0
- ErrIncompatibleCNIVersion // 1
- ErrUnsupportedField // 2
+ ErrUnknown uint = iota // 0
+ ErrIncompatibleCNIVersion // 1
+ ErrUnsupportedField // 2
+ ErrUnknownContainer // 3
+ ErrInvalidEnvironmentVariables // 4
+ ErrIOFailure // 5
+ ErrDecodingFailure // 6
+ ErrInvalidNetworkConfig // 7
+ ErrTryAgainLater uint = 11
+ ErrInternal uint = 999
)
type Error struct {
@@ -145,6 +151,14 @@ type Error struct {
Details string `json:"details,omitempty"`
}
+func NewError(code uint, msg, details string) *Error {
+ return &Error{
+ Code: code,
+ Msg: msg,
+ Details: details,
+ }
+}
+
func (e *Error) Error() string {
details := ""
if e.Details != "" {
@@ -194,6 +208,3 @@ func prettyPrint(obj interface{}) error {
_, err = os.Stdout.Write(data)
return err
}
-
-// NotImplementedError is used to indicate that a method is not implemented for the given platform
-var NotImplementedError = errors.New("Not Implemented")