From e028b70b49796e304547d79761d0f3f24f457aac Mon Sep 17 00:00:00 2001 From: Casey Callendrello Date: Wed, 10 Apr 2019 17:16:27 +0200 Subject: [PATCH] vendor: bump libcni to v0.7.0-rc2 --- Godeps/Godeps.json | 32 +++++++++---------- .../containernetworking/cni/libcni/api.go | 2 +- .../cni/pkg/invoke/os_unix.go | 2 +- .../containernetworking/cni/pkg/skel/skel.go | 2 +- .../cni/pkg/types/020/types.go | 7 +++- .../cni/pkg/types/current/types.go | 19 +++++------ .../cni/pkg/types/types.go | 6 +++- .../cni/pkg/version/plugin.go | 10 ++++-- 8 files changed, 45 insertions(+), 35 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index d1c2e2df..901223b9 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "github.com/containernetworking/plugins", "GoVersion": "go1.7", - "GodepVersion": "v79", + "GodepVersion": "v80", "Packages": [ "./..." ], @@ -14,7 +14,7 @@ { "ImportPath": "github.com/Microsoft/hcsshim", "Comment": "v0.7.6", - "Rev": "6efef912cc0ecd8778bab95d105662d4f73f8ccd" + "Rev": "e44e499d29527b244d6858772f1b9090eeaddc4e" }, { "ImportPath": "github.com/Microsoft/hcsshim/internal/guid", @@ -81,38 +81,38 @@ }, { "ImportPath": "github.com/containernetworking/cni/libcni", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/invoke", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/skel", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/types", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/types/020", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/types/current", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/containernetworking/cni/pkg/version", - "Comment": "v0.7.0-alpha1", - "Rev": "07c1a6da47b7fbf8b357f4949ecce2113e598491" + "Comment": "v0.7.0-rc2", + "Rev": "fbb95fff8a5239a4295c991efa8a397d43118f7e" }, { "ImportPath": "github.com/coreos/go-iptables/iptables", diff --git a/vendor/github.com/containernetworking/cni/libcni/api.go b/vendor/github.com/containernetworking/cni/libcni/api.go index dd3e1680..360733e7 100644 --- a/vendor/github.com/containernetworking/cni/libcni/api.go +++ b/vendor/github.com/containernetworking/cni/libcni/api.go @@ -126,7 +126,7 @@ func buildOneConfig(name, cniVersion string, orig *NetworkConfig, prevResult typ // These capabilities arguments are filtered through the plugin's advertised // capabilities from its config JSON, and any keys in the CapabilityArgs // matching plugin capabilities are added to the "runtimeConfig" dictionary -// sent to the plugin via JSON on stdin. For exmaple, if the plugin's +// sent to the plugin via JSON on stdin. For example, if the plugin's // capabilities include "portMappings", and the CapabilityArgs map includes a // "portMappings" key, that key and its value are added to the "runtimeConfig" // dictionary to be passed to the plugin's stdin. diff --git a/vendor/github.com/containernetworking/cni/pkg/invoke/os_unix.go b/vendor/github.com/containernetworking/cni/pkg/invoke/os_unix.go index bab5737a..9bcfb455 100644 --- a/vendor/github.com/containernetworking/cni/pkg/invoke/os_unix.go +++ b/vendor/github.com/containernetworking/cni/pkg/invoke/os_unix.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build darwin dragonfly freebsd linux netbsd opensbd solaris +// +build darwin dragonfly freebsd linux netbsd openbsd solaris package invoke diff --git a/vendor/github.com/containernetworking/cni/pkg/skel/skel.go b/vendor/github.com/containernetworking/cni/pkg/skel/skel.go index d6062a11..af56b8a1 100644 --- a/vendor/github.com/containernetworking/cni/pkg/skel/skel.go +++ b/vendor/github.com/containernetworking/cni/pkg/skel/skel.go @@ -291,7 +291,7 @@ func PluginMainWithError(cmdAdd, cmdCheck, cmdDel func(_ *CmdArgs) error, versio // The caller must also specify what CNI spec versions the plugin supports. // // The caller can specify an "about" string, which is printed on stderr -// when no CNI_COMMAND is specified. The reccomended output is "CNI plugin v" +// when no CNI_COMMAND is specified. The recommended output is "CNI plugin v" // // When an error occurs in either cmdAdd, cmdCheck, or cmdDel, PluginMain will print the error // as JSON to stdout and call os.Exit(1). diff --git a/vendor/github.com/containernetworking/cni/pkg/types/020/types.go b/vendor/github.com/containernetworking/cni/pkg/types/020/types.go index 2833aba7..53256167 100644 --- a/vendor/github.com/containernetworking/cni/pkg/types/020/types.go +++ b/vendor/github.com/containernetworking/cni/pkg/types/020/types.go @@ -17,6 +17,7 @@ package types020 import ( "encoding/json" "fmt" + "io" "net" "os" @@ -73,11 +74,15 @@ func (r *Result) GetAsVersion(version string) (types.Result, error) { } func (r *Result) Print() error { + return r.PrintTo(os.Stdout) +} + +func (r *Result) PrintTo(writer io.Writer) error { data, err := json.MarshalIndent(r, "", " ") if err != nil { return err } - _, err = os.Stdout.Write(data) + _, err = writer.Write(data) return err } diff --git a/vendor/github.com/containernetworking/cni/pkg/types/current/types.go b/vendor/github.com/containernetworking/cni/pkg/types/current/types.go index 71a634fe..7267a2e6 100644 --- a/vendor/github.com/containernetworking/cni/pkg/types/current/types.go +++ b/vendor/github.com/containernetworking/cni/pkg/types/current/types.go @@ -17,6 +17,7 @@ package current import ( "encoding/json" "fmt" + "io" "net" "os" @@ -75,13 +76,9 @@ func convertFrom020(result types.Result) (*Result, error) { Gateway: oldResult.IP4.Gateway, }) for _, route := range oldResult.IP4.Routes { - gw := route.GW - if gw == nil { - gw = oldResult.IP4.Gateway - } newResult.Routes = append(newResult.Routes, &types.Route{ Dst: route.Dst, - GW: gw, + GW: route.GW, }) } } @@ -93,13 +90,9 @@ func convertFrom020(result types.Result) (*Result, error) { Gateway: oldResult.IP6.Gateway, }) for _, route := range oldResult.IP6.Routes { - gw := route.GW - if gw == nil { - gw = oldResult.IP6.Gateway - } newResult.Routes = append(newResult.Routes, &types.Route{ Dst: route.Dst, - GW: gw, + GW: route.GW, }) } } @@ -202,11 +195,15 @@ func (r *Result) GetAsVersion(version string) (types.Result, error) { } func (r *Result) Print() error { + return r.PrintTo(os.Stdout) +} + +func (r *Result) PrintTo(writer io.Writer) error { data, err := json.MarshalIndent(r, "", " ") if err != nil { return err } - _, err = os.Stdout.Write(data) + _, err = writer.Write(data) return err } diff --git a/vendor/github.com/containernetworking/cni/pkg/types/types.go b/vendor/github.com/containernetworking/cni/pkg/types/types.go index 5e49f117..d0d11006 100644 --- a/vendor/github.com/containernetworking/cni/pkg/types/types.go +++ b/vendor/github.com/containernetworking/cni/pkg/types/types.go @@ -18,6 +18,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "net" "os" ) @@ -87,7 +88,7 @@ type ResultFactoryFunc func([]byte) (Result, error) // Result is an interface that provides the result of plugin execution type Result interface { - // The highest CNI specification result verison the result supports + // The highest CNI specification result version the result supports // without having to convert Version() string @@ -98,6 +99,9 @@ type Result interface { // Prints the result in JSON format to stdout Print() error + // Prints the result in JSON format to provided writer + PrintTo(writer io.Writer) error + // Returns a JSON string representation of the result String() string } diff --git a/vendor/github.com/containernetworking/cni/pkg/version/plugin.go b/vendor/github.com/containernetworking/cni/pkg/version/plugin.go index 612335a8..1df42724 100644 --- a/vendor/github.com/containernetworking/cni/pkg/version/plugin.go +++ b/vendor/github.com/containernetworking/cni/pkg/version/plugin.go @@ -86,9 +86,13 @@ func (*PluginDecoder) Decode(jsonBytes []byte) (PluginInfo, error) { // minor, and micro numbers or returns an error func ParseVersion(version string) (int, int, int, error) { var major, minor, micro int + if version == "" { + return -1, -1, -1, fmt.Errorf("invalid version %q: the version is empty", version) + } + parts := strings.Split(version, ".") - if len(parts) == 0 || len(parts) >= 4 { - return -1, -1, -1, fmt.Errorf("invalid version %q: too many or too few parts", version) + if len(parts) >= 4 { + return -1, -1, -1, fmt.Errorf("invalid version %q: too many parts", version) } major, err := strconv.Atoi(parts[0]) @@ -114,7 +118,7 @@ func ParseVersion(version string) (int, int, int, error) { } // GreaterThanOrEqualTo takes two string versions, parses them into major/minor/micro -// nubmers, and compares them to determine whether the first version is greater +// numbers, and compares them to determine whether the first version is greater // than or equal to the second func GreaterThanOrEqualTo(version, otherVersion string) (bool, error) { firstMajor, firstMinor, firstMicro, err := ParseVersion(version)