Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cni for openSUSE:Factory checked in at 2022-11-18 15:43:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cni (Old) and /work/SRC/openSUSE:Factory/.cni.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cni" Fri Nov 18 15:43:11 2022 rev:16 rq:1036469 version:1.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/cni/cni.changes 2022-11-16 15:43:01.347757581 +0100 +++ /work/SRC/openSUSE:Factory/.cni.new.1597/cni.changes 2022-11-18 15:43:36.922583769 +0100 @@ -1,0 +2,11 @@ +Thu Nov 10 14:06:19 UTC 2022 - Andrea Manzini <andrea.manz...@suse.com> + +- Update to version 1.1.2: + * spec: fix format + * libcni: handle empty version when parsing version + * [exec-plugins]: support plugin lists + + This is a minor update to the CNI libraries and tooling. + This does not bump the protocol / spec version, which remains at v1.0.0 + +------------------------------------------------------------------- Old: ---- cni-1.0.1.tar.gz New: ---- cni-1.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cni.spec ++++++ --- /var/tmp/diff_new_pack.TMow3e/_old 2022-11-18 15:43:37.658587003 +0100 +++ /var/tmp/diff_new_pack.TMow3e/_new 2022-11-18 15:43:37.662587020 +0100 @@ -22,7 +22,7 @@ %define cni_bin_dir %{_libexecdir}/cni %define cni_doc_dir %{_docdir}/cni Name: cni -Version: 1.0.1 +Version: 1.1.2 Release: 0 Summary: Container Network Interface - networking for Linux containers License: Apache-2.0 ++++++ cni-1.0.1.tar.gz -> cni-1.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/.github/workflows/test.yaml new/cni-1.1.2/.github/workflows/test.yaml --- old/cni-1.0.1/.github/workflows/test.yaml 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/.github/workflows/test.yaml 2022-07-27 17:46:15.000000000 +0200 @@ -4,7 +4,7 @@ on: ["push", "pull_request"] env: - GO_VERSION: "1.15" + GO_VERSION: "1.16" LINUX_ARCHES: "amd64 386 arm arm64 s390x mips64le ppc64le" jobs: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/MAINTAINERS new/cni-1.1.2/MAINTAINERS --- old/cni-1.0.1/MAINTAINERS 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/MAINTAINERS 2022-07-27 17:46:15.000000000 +0200 @@ -1,7 +1,7 @@ Bruce Ma <brucema19901...@gmail.com> (@mars1024) Casey Callendrello <c...@redhat.com> (@squeed) Dan Williams <d...@redhat.com> (@dcbw) -Gabe Rosenhouse <grosenho...@pivotal.io> (@rosenhouse) Matt Dupre <m...@tigera.io> (@matthewdupre) Michael Cambria <mcamb...@redhat.com> (@mccv1r0) -Piotr Skamruk <piotr.skam...@gmail.com> (@jellonek) +Michael Zappa <michael.za...@stateless.net> (@MikeZappa87) +Piotr Skamruk <piotr.skam...@gmail.com> (@jellonek) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/README.md new/cni-1.1.2/README.md --- old/cni-1.0.1/README.md 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/README.md 2022-07-27 17:46:15.000000000 +0200 @@ -45,7 +45,7 @@ - [SR-IOV](https://github.com/hustcat/sriov-cni) - [Cilium - BPF & XDP for containers](https://github.com/cilium/cilium) - [Infoblox - enterprise IP address management for containers](https://github.com/infobloxopen/cni-infoblox) -- [Multus - a Multi plugin](https://github.com/Intel-Corp/multus-cni) +- [Multus - a Multi plugin](https://github.com/k8snetworkplumbingwg/multus-cni) - [Romana - Layer 3 CNI plugin supporting network policy for Kubernetes](https://github.com/romana/kube) - [CNI-Genie - generic CNI network plugin](https://github.com/Huawei-PaaS/CNI-Genie) - [Nuage CNI - Nuage Networks SDN plugin for network policy kubernetes support ](https://github.com/nuagenetworks/nuage-cni) @@ -66,6 +66,8 @@ - [Project Antrea - an Open vSwitch k8s CNI](https://github.com/vmware-tanzu/antrea) - [OVN4NFV-K8S-Plugin - a OVN based CNI controller plugin to provide cloud native based Service function chaining (SFC), Multiple OVN overlay networking](https://github.com/opnfv/ovn4nfv-k8s-plugin) - [Azure CNI - a CNI plugin that natively extends Azure Virtual Networks to containers](https://github.com/Azure/azure-container-networking) +- [NetLOX Loxilight - Loxilight CNI is based on TC eBPF. It works either as a pure eBPF mode or in a hybrid-mode with multi-vendor DPU support when DPU units are available](https://www.netlox.io/product) +- [Hybridnet - a CNI plugin designed for hybrid clouds which provides both overlay and underlay networking for containers in one or more clusters. Overlay and underlay containers can run on the same node and have cluster-wide bidirectional network connectivity.](https://github.com/alibaba/hybridnet) The CNI team also maintains some [core plugins in a separate repository](https://github.com/containernetworking/plugins). @@ -212,4 +214,6 @@ - IRC: #[containernetworking](irc://irc.freenode.net:6667/#containernetworking) channel on [freenode.net](https://freenode.net/) - Slack: #cni on the [CNCF slack](https://slack.cncf.io/). NOTE: the previous CNI Slack (containernetworking.slack.com) has been sunsetted. +## Security + If you have a _security_ issue to report, please do so privately to the email addresses listed in the [MAINTAINERS](MAINTAINERS) file. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/SPEC.md new/cni-1.1.2/SPEC.md --- old/cni-1.0.1/SPEC.md 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/SPEC.md 2022-07-27 17:46:15.000000000 +0200 @@ -337,6 +337,7 @@ - _delete_ may be followed by additional _deletes_. - The network configuration should not change between _add_ and _delete_. - The network configuration should not change between _attachments_. +- The container runtime is responsible for cleanup of the container's network namespace. ### Attachment Parameters While a network configuration should not change between _attachments_, there are certain parameters supplied by the container runtime that are per-attachment. They are: @@ -468,7 +469,7 @@ - _Success_ (or _Abbreviated Success_) - _Error_ -- _Version +- _Version_ ### Success diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/cnitool/cnitool.go new/cni-1.1.2/cnitool/cnitool.go --- old/cni-1.0.1/cnitool/cnitool.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/cnitool/cnitool.go 2022-07-27 17:46:15.000000000 +0200 @@ -26,6 +26,7 @@ "github.com/containernetworking/cni/libcni" ) +// Protocol parameters are passed to the plugins via OS environment variables. const ( EnvCNIPath = "CNI_PATH" EnvNetDir = "NETCONFPATH" @@ -59,7 +60,6 @@ func main() { if len(os.Args) < 4 { usage() - return } netdir := os.Getenv(EnvNetDir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/go.mod new/cni-1.1.2/go.mod --- old/cni-1.0.1/go.mod 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/go.mod 2022-07-27 17:46:15.000000000 +0200 @@ -3,6 +3,6 @@ go 1.14 require ( - github.com/onsi/ginkgo v1.13.0 - github.com/onsi/gomega v1.10.1 + github.com/onsi/ginkgo/v2 v2.1.3 + github.com/onsi/gomega v1.17.0 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/go.sum new/cni-1.1.2/go.sum --- old/cni-1.0.1/go.sum 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/go.sum 2022-07-27 17:46:15.000000000 +0200 @@ -1,60 +1,103 @@ +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/libcni/api_test.go new/cni-1.1.2/libcni/api_test.go --- old/cni-1.0.1/libcni/api_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/libcni/api_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -34,7 +34,7 @@ current "github.com/containernetworking/cni/pkg/types/100" noop_debug "github.com/containernetworking/cni/plugins/test/noop/debug" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/libcni/backwards_compatibility_test.go new/cni-1.1.2/libcni/backwards_compatibility_test.go --- old/cni-1.0.1/libcni/backwards_compatibility_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/libcni/backwards_compatibility_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -26,7 +26,7 @@ "github.com/containernetworking/cni/libcni" "github.com/containernetworking/cni/pkg/version/legacy_examples" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" ) @@ -66,6 +66,9 @@ Expect(result).To(Equal(legacy_examples.ExpectedResult)) + err = cniConfig.DelNetwork(context.TODO(), netConf, runtimeConf) + Expect(err).NotTo(HaveOccurred()) + Expect(os.RemoveAll(pluginPath)).To(Succeed()) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/libcni/conf.go new/cni-1.1.2/libcni/conf.go --- old/cni-1.0.1/libcni/conf.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/libcni/conf.go 2022-07-27 17:46:15.000000000 +0200 @@ -21,6 +21,8 @@ "os" "path/filepath" "sort" + + "github.com/containernetworking/cni/pkg/types" ) type NotFoundError struct { @@ -41,8 +43,8 @@ } func ConfFromBytes(bytes []byte) (*NetworkConfig, error) { - conf := &NetworkConfig{Bytes: bytes} - if err := json.Unmarshal(bytes, &conf.Network); err != nil { + conf := &NetworkConfig{Bytes: bytes, Network: &types.NetConf{}} + if err := json.Unmarshal(bytes, conf.Network); err != nil { return nil, fmt.Errorf("error parsing configuration: %w", err) } if conf.Network.Type == "" { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/libcni/conf_test.go new/cni-1.1.2/libcni/conf_test.go --- old/cni-1.0.1/libcni/conf_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/libcni/conf_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -21,7 +21,7 @@ "github.com/containernetworking/cni/libcni" "github.com/containernetworking/cni/pkg/types" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/libcni/libcni_suite_test.go new/cni-1.1.2/libcni/libcni_suite_test.go --- old/cni-1.0.1/libcni/libcni_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/libcni/libcni_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -18,7 +18,7 @@ "encoding/json" "path/filepath" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/args_test.go new/cni-1.1.2/pkg/invoke/args_test.go --- old/cni-1.0.1/pkg/invoke/args_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/args_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -19,7 +19,7 @@ "github.com/containernetworking/cni/pkg/invoke" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/delegate_test.go new/cni-1.1.2/pkg/invoke/delegate_test.go --- old/cni-1.0.1/pkg/invoke/delegate_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/delegate_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -26,7 +26,7 @@ current "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/cni/plugins/test/noop/debug" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/exec.go new/cni-1.1.2/pkg/invoke/exec.go --- old/cni-1.0.1/pkg/invoke/exec.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/exec.go 2022-07-27 17:46:15.000000000 +0200 @@ -16,6 +16,7 @@ import ( "context" + "encoding/json" "fmt" "os" @@ -33,6 +34,49 @@ Decode(jsonBytes []byte) (version.PluginInfo, error) } +// Plugin must return result in same version as specified in netconf; but +// for backwards compatibility reasons if the result version is empty use +// config version (rather than technically correct 0.1.0). +// https://github.com/containernetworking/cni/issues/895 +func fixupResultVersion(netconf, result []byte) (string, []byte, error) { + versionDecoder := &version.ConfigDecoder{} + confVersion, err := versionDecoder.Decode(netconf) + if err != nil { + return "", nil, err + } + + var rawResult map[string]interface{} + if err := json.Unmarshal(result, &rawResult); err != nil { + return "", nil, fmt.Errorf("failed to unmarshal raw result: %w", err) + } + + // plugin output of "null" is successfully unmarshalled, but results in a nil + // map which causes a panic when the confVersion is assigned below. + if rawResult == nil { + rawResult = make(map[string]interface{}) + } + + // Manually decode Result version; we need to know whether its cniVersion + // is empty, while built-in decoders (correctly) substitute 0.1.0 for an + // empty version per the CNI spec. + if resultVerRaw, ok := rawResult["cniVersion"]; ok { + resultVer, ok := resultVerRaw.(string) + if ok && resultVer != "" { + return resultVer, result, nil + } + } + + // If the cniVersion is not present or empty, assume the result is + // the same CNI spec version as the config + rawResult["cniVersion"] = confVersion + newBytes, err := json.Marshal(rawResult) + if err != nil { + return "", nil, fmt.Errorf("failed to remarshal fixed result: %w", err) + } + + return confVersion, newBytes, nil +} + // For example, a testcase could pass an instance of the following fakeExec // object to ExecPluginWithResult() to verify the incoming stdin and environment // and provide a tailored response: @@ -84,7 +128,12 @@ return nil, err } - return create.CreateFromBytes(stdoutBytes) + resultVersion, fixedBytes, err := fixupResultVersion(netconf, stdoutBytes) + if err != nil { + return nil, err + } + + return create.Create(resultVersion, fixedBytes) } func ExecPluginWithoutResult(ctx context.Context, pluginPath string, netconf []byte, args CNIArgs, exec Exec) error { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/exec_test.go new/cni-1.1.2/pkg/invoke/exec_test.go --- old/cni-1.0.1/pkg/invoke/exec_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/exec_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -24,7 +24,7 @@ current "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -96,6 +96,38 @@ _, err := invoke.ExecPluginWithResult(ctx, pluginPath, netconf, cniargs, nil) Expect(err).To(HaveOccurred()) }) + + It("assumes config version if result version is missing", func() { + rawExec.ExecPluginCall.Returns.ResultBytes = []byte(`{ "ips": [ { "version": "4", "address": "1.2.3.4/24" } ] }`) + r, err := invoke.ExecPluginWithResult(ctx, pluginPath, netconf, cniargs, pluginExec) + Expect(err).NotTo(HaveOccurred()) + Expect(r.Version()).To(Equal("0.3.1")) + + result, err := current.GetResult(r) + Expect(err).NotTo(HaveOccurred()) + Expect(len(result.IPs)).To(Equal(1)) + Expect(result.IPs[0].Address.IP.String()).To(Equal("1.2.3.4")) + }) + + It("assumes config version if result version is empty", func() { + rawExec.ExecPluginCall.Returns.ResultBytes = []byte(`{ "cniVersion": "", "ips": [ { "version": "4", "address": "1.2.3.4/24" } ] }`) + r, err := invoke.ExecPluginWithResult(ctx, pluginPath, netconf, cniargs, pluginExec) + Expect(err).NotTo(HaveOccurred()) + Expect(r.Version()).To(Equal("0.3.1")) + + result, err := current.GetResult(r) + Expect(err).NotTo(HaveOccurred()) + Expect(len(result.IPs)).To(Equal(1)) + Expect(result.IPs[0].Address.IP.String()).To(Equal("1.2.3.4")) + }) + + It("assumes 0.1.0 if config and result version are empty", func() { + netconf = []byte(`{ "some": "stdin" }`) + rawExec.ExecPluginCall.Returns.ResultBytes = []byte(`{ "some": "version-info" }`) + r, err := invoke.ExecPluginWithResult(ctx, pluginPath, netconf, cniargs, pluginExec) + Expect(err).NotTo(HaveOccurred()) + Expect(r.Version()).To(Equal("0.1.0")) + }) }) Describe("without returning a result", func() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/find_test.go new/cni-1.1.2/pkg/invoke/find_test.go --- old/cni-1.0.1/pkg/invoke/find_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/find_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -22,7 +22,7 @@ "strings" "github.com/containernetworking/cni/pkg/invoke" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/get_version_integration_test.go new/cni-1.1.2/pkg/invoke/get_version_integration_test.go --- old/cni-1.0.1/pkg/invoke/get_version_integration_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/get_version_integration_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -25,8 +25,7 @@ "github.com/containernetworking/cni/pkg/version" "github.com/containernetworking/cni/pkg/version/testhelpers" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/invoke_suite_test.go new/cni-1.1.2/pkg/invoke/invoke_suite_test.go --- old/cni-1.0.1/pkg/invoke/invoke_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/invoke_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package invoke_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/invoke/raw_exec_test.go new/cni-1.1.2/pkg/invoke/raw_exec_test.go --- old/cni-1.0.1/pkg/invoke/raw_exec_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/invoke/raw_exec_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -24,7 +24,7 @@ noop_debug "github.com/containernetworking/cni/plugins/test/noop/debug" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/skel/skel.go new/cni-1.1.2/pkg/skel/skel.go --- old/cni-1.0.1/pkg/skel/skel.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/skel/skel.go 2022-07-27 17:46:15.000000000 +0200 @@ -196,6 +196,7 @@ // Print the about string to stderr when no command is set if err.Code == types.ErrInvalidEnvironmentVariables && t.Getenv("CNI_COMMAND") == "" && about != "" { _, _ = fmt.Fprintln(t.Stderr, about) + _, _ = fmt.Fprintf(t.Stderr, "CNI protocol versions supported: %s\n", strings.Join(versionInfo.SupportedVersions(), ", ")) return nil } return err @@ -248,10 +249,7 @@ return types.NewError(types.ErrInvalidEnvironmentVariables, fmt.Sprintf("unknown CNI_COMMAND: %v", cmd), "") } - if err != nil { - return err - } - return nil + return err } // PluginMainWithError is the core "main" for a plugin. It accepts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/skel/skel_suite_test.go new/cni-1.1.2/pkg/skel/skel_suite_test.go --- old/cni-1.0.1/pkg/skel/skel_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/skel/skel_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package skel import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/skel/skel_test.go new/cni-1.1.2/pkg/skel/skel_test.go --- old/cni-1.0.1/pkg/skel/skel_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/skel/skel_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -24,8 +24,7 @@ current "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -69,7 +68,7 @@ stdinData = `{ "name":"skel-test", "some": "config", "cniVersion": "9.8.7" }` stdout = &bytes.Buffer{} stderr = &bytes.Buffer{} - versionInfo = version.PluginSupports("9.8.7") + versionInfo = version.PluginSupports("9.8.7", "10.0.0") dispatch = &dispatcher{ Getenv: func(key string) string { return environment[key] }, Stdin: strings.NewReader(stdinData), @@ -430,7 +429,7 @@ Expect(err).NotTo(HaveOccurred()) Expect(stdout).To(MatchJSON(fmt.Sprintf(`{ "cniVersion": "%s", - "supportedVersions": ["9.8.7"] + "supportedVersions": ["9.8.7", "10.0.0"] }`, current.ImplementedSpecVersion))) }) @@ -461,7 +460,7 @@ Expect(r.ReadCount).To(Equal(0)) Expect(stdout).To(MatchJSON(fmt.Sprintf(`{ "cniVersion": "%s", - "supportedVersions": ["9.8.7"] + "supportedVersions": ["9.8.7", "10.0.0"] }`, current.ImplementedSpecVersion))) }) }) @@ -503,7 +502,7 @@ Expect(cmdAdd.CallCount).To(Equal(0)) Expect(cmdDel.CallCount).To(Equal(0)) log := stderr.String() - Expect(log).To(Equal("AWESOME PLUGIN\n")) + Expect(log).To(Equal("AWESOME PLUGIN\nCNI protocol versions supported: 9.8.7, 10.0.0\n")) }) It("fails if there is no about string", func() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/020/types_suite_test.go new/cni-1.1.2/pkg/types/020/types_suite_test.go --- old/cni-1.0.1/pkg/types/020/types_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/020/types_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package types020_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/020/types_test.go new/cni-1.1.2/pkg/types/020/types_test.go --- old/cni-1.0.1/pkg/types/020/types_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/020/types_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -23,7 +23,7 @@ "github.com/containernetworking/cni/pkg/types/020" "github.com/containernetworking/cni/pkg/types/create" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/040/types_suite_test.go new/cni-1.1.2/pkg/types/040/types_suite_test.go --- old/cni-1.0.1/pkg/types/040/types_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/040/types_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package types040_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/040/types_test.go new/cni-1.1.2/pkg/types/040/types_test.go --- old/cni-1.0.1/pkg/types/040/types_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/040/types_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -24,7 +24,7 @@ types020 "github.com/containernetworking/cni/pkg/types/020" types040 "github.com/containernetworking/cni/pkg/types/040" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -348,7 +348,7 @@ }`)) recovered := &types040.IPConfig{} - Expect(json.Unmarshal(jsonBytes, &recovered)).To(Succeed()) + Expect(json.Unmarshal(jsonBytes, recovered)).To(Succeed()) Expect(recovered).To(Equal(ipc)) }) @@ -363,7 +363,7 @@ Context("when unmarshalling json fails", func() { It("returns an error", func() { recovered := &types040.IPConfig{} - err := json.Unmarshal([]byte(`{"address": 5}`), &recovered) + err := json.Unmarshal([]byte(`{"address": 5}`), recovered) Expect(err).To(MatchError(HavePrefix("json: cannot unmarshal"))) }) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/100/types_suite_test.go new/cni-1.1.2/pkg/types/100/types_suite_test.go --- old/cni-1.0.1/pkg/types/100/types_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/100/types_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package types100_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/100/types_test.go new/cni-1.1.2/pkg/types/100/types_test.go --- old/cni-1.0.1/pkg/types/100/types_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/100/types_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -23,7 +23,7 @@ "github.com/containernetworking/cni/pkg/types" current "github.com/containernetworking/cni/pkg/types/100" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -295,14 +295,14 @@ }`)) recovered := ¤t.IPConfig{} - Expect(json.Unmarshal(jsonBytes, &recovered)).To(Succeed()) + Expect(json.Unmarshal(jsonBytes, recovered)).To(Succeed()) Expect(recovered).To(Equal(ipc)) }) Context("when unmarshalling json fails", func() { It("returns an error", func() { recovered := ¤t.IPConfig{} - err := json.Unmarshal([]byte(`{"address": 5}`), &recovered) + err := json.Unmarshal([]byte(`{"address": 5}`), recovered) Expect(err).To(MatchError(HavePrefix("json: cannot unmarshal"))) }) }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/args_test.go new/cni-1.1.2/pkg/types/args_test.go --- old/cni-1.0.1/pkg/types/args_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/args_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -20,8 +20,7 @@ . "github.com/containernetworking/cni/pkg/types" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/types_suite_test.go new/cni-1.1.2/pkg/types/types_suite_test.go --- old/cni-1.0.1/pkg/types/types_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/types_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package types_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/types/types_test.go new/cni-1.1.2/pkg/types/types_test.go --- old/cni-1.0.1/pkg/types/types_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/types/types_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -20,8 +20,7 @@ "github.com/containernetworking/cni/pkg/types" current "github.com/containernetworking/cni/pkg/types/100" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/conf_test.go new/cni-1.1.2/pkg/version/conf_test.go --- old/cni-1.0.1/pkg/version/conf_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/conf_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -17,7 +17,7 @@ import ( "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/legacy_examples/legacy_examples_suite_test.go new/cni-1.1.2/pkg/version/legacy_examples/legacy_examples_suite_test.go --- old/cni-1.0.1/pkg/version/legacy_examples/legacy_examples_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/legacy_examples/legacy_examples_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package legacy_examples_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/legacy_examples/legacy_examples_test.go new/cni-1.1.2/pkg/version/legacy_examples/legacy_examples_test.go --- old/cni-1.0.1/pkg/version/legacy_examples/legacy_examples_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/legacy_examples/legacy_examples_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -20,7 +20,7 @@ "runtime" "github.com/containernetworking/cni/pkg/version/legacy_examples" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/plugin.go new/cni-1.1.2/pkg/version/plugin.go --- old/cni-1.0.1/pkg/version/plugin.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/plugin.go 2022-07-27 17:46:15.000000000 +0200 @@ -86,8 +86,8 @@ // 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) + if version == "" { // special case: no version declared == v0.1.0 + return 0, 1, 0, nil } parts := strings.Split(version, ".") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/plugin_test.go new/cni-1.1.2/pkg/version/plugin_test.go --- old/cni-1.0.1/pkg/version/plugin_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/plugin_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -16,7 +16,7 @@ import ( "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -91,8 +91,16 @@ Expect(micro).To(Equal(3)) }) + It("parses an empty string as v0.1.0", func() { + major, minor, micro, err := version.ParseVersion("") + Expect(err).NotTo(HaveOccurred()) + Expect(major).To(Equal(0)) + Expect(minor).To(Equal(1)) + Expect(micro).To(Equal(0)) + }) + It("returns an error for malformed versions", func() { - badVersions := []string{"asdfasdf", "asdf.", ".asdfas", "asdf.adsf.", "0.", "..", "1.2.3.4.5", ""} + badVersions := []string{"asdfasdf", "asdf.", ".asdfas", "asdf.adsf.", "0.", "..", "1.2.3.4.5"} for _, v := range badVersions { _, _, _, err := version.ParseVersion(v) Expect(err).To(HaveOccurred()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/reconcile_test.go new/cni-1.1.2/pkg/version/reconcile_test.go --- old/cni-1.0.1/pkg/version/reconcile_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/reconcile_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -16,7 +16,7 @@ import ( "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/testhelpers/testhelpers_suite_test.go new/cni-1.1.2/pkg/version/testhelpers/testhelpers_suite_test.go --- old/cni-1.0.1/pkg/version/testhelpers/testhelpers_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/testhelpers/testhelpers_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package testhelpers_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/testhelpers/testhelpers_test.go new/cni-1.1.2/pkg/version/testhelpers/testhelpers_test.go --- old/cni-1.0.1/pkg/version/testhelpers/testhelpers_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/testhelpers/testhelpers_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -20,7 +20,7 @@ "path/filepath" "runtime" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/version_suite_test.go new/cni-1.1.2/pkg/version/version_suite_test.go --- old/cni-1.0.1/pkg/version/version_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/version_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package version_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "testing" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/pkg/version/version_test.go new/cni-1.1.2/pkg/version/version_test.go --- old/cni-1.0.1/pkg/version/version_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/pkg/version/version_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -23,7 +23,7 @@ current "github.com/containernetworking/cni/pkg/types/100" "github.com/containernetworking/cni/pkg/version" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/plugins/debug/go.mod new/cni-1.1.2/plugins/debug/go.mod --- old/cni-1.0.1/plugins/debug/go.mod 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/plugins/debug/go.mod 2022-07-27 17:46:15.000000000 +0200 @@ -3,6 +3,6 @@ go 1.14 require ( - github.com/containernetworking/cni v0.8.1 + github.com/containernetworking/cni v1.0.1 github.com/containernetworking/plugins v0.9.1 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/plugins/debug/go.sum new/cni-1.1.2/plugins/debug/go.sum --- old/cni-1.0.1/plugins/debug/go.sum 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/plugins/debug/go.sum 2022-07-27 17:46:15.000000000 +0200 @@ -2,8 +2,9 @@ github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v1.0.1 h1:9OIL/sZmMYDBe+G8svzILAlulUpaDTUjeAbtH/JNLBo= +github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= github.com/containernetworking/plugins v0.9.1 h1:FD1tADPls2EEi3flPc2OegIY1M9pUa9r2Quag7HMLV8= github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= @@ -14,6 +15,8 @@ github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -21,20 +24,28 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -44,32 +55,44 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637 h1:O5hKNaGxIT4A8OTMnuh6UpmBdI3SAPxlZ3g0olDrJVM= golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/plugins/test/noop/noop_suite_test.go new/cni-1.1.2/plugins/test/noop/noop_suite_test.go --- old/cni-1.0.1/plugins/test/noop/noop_suite_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/plugins/test/noop/noop_suite_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -15,7 +15,7 @@ package main_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/plugins/test/noop/noop_test.go new/cni-1.1.2/plugins/test/noop/noop_test.go --- old/cni-1.0.1/plugins/test/noop/noop_test.go 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/plugins/test/noop/noop_test.go 2022-07-27 17:46:15.000000000 +0200 @@ -25,7 +25,7 @@ "github.com/containernetworking/cni/pkg/types" "github.com/containernetworking/cni/pkg/version" noop_debug "github.com/containernetworking/cni/plugins/test/noop/debug" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cni-1.0.1/scripts/exec-plugins.sh new/cni-1.1.2/scripts/exec-plugins.sh --- old/cni-1.0.1/scripts/exec-plugins.sh 2021-09-07 15:04:59.000000000 +0200 +++ new/cni-1.1.2/scripts/exec-plugins.sh 2022-07-27 17:46:15.000000000 +0200 @@ -2,7 +2,36 @@ if [[ ${DEBUG} -gt 0 ]]; then set -x; fi -NETCONFPATH=${NETCONFPATH-/etc/cni/net.d} +NETCONFPATH="${NETCONFPATH-/etc/cni/net.d}" + +function exec_list() { + plist="$1" + name="$2" + cniVersion="$3" + echo "$plist" | jq -c '.[]' | while read -r conf; do + plugin_bin="$(echo "$conf" | jq -r '.type')" + conf="$(echo "$conf" | jq -r ".name = \"$name\" | .cniVersion = \"$cniVersion\"")" + if [ -n "$res" ]; then + conf="$(echo "$conf" | jq -r ".prevResult=$res")" + fi + if ! res=$(echo "$conf" | $plugin_bin); then + error "$name" "$res" + elif [[ ${DEBUG} -gt 0 ]]; then + echo "${res}" | jq -r . + fi + done +} + +function error () { + name="$1" + res="$2" + err_msg=$(echo "$res" | jq -r '.msg') + if [ -z "$errmsg" ]; then + err_msg=$res + fi + echo "${name} : error executing $CNI_COMMAND: $err_msg" + exit 1 +} function exec_plugins() { i=0 @@ -13,25 +42,24 @@ export CNI_CONTAINERID=$contid export CNI_NETNS=$netns - for netconf in $(echo $NETCONFPATH/*.conf | sort); do - name=$(jq -r '.name' <$netconf) - plugin=$(jq -r '.type' <$netconf) - export CNI_IFNAME=$(printf eth%d $i) - - res=$($plugin <$netconf) - if [ $? -ne 0 ]; then - errmsg=$(echo $res | jq -r '.msg') - if [ -z "$errmsg" ]; then - errmsg=$res - fi - - echo "${name} : error executing $CNI_COMMAND: $errmsg" - exit 1 - elif [[ ${DEBUG} -gt 0 ]]; then - echo ${res} | jq -r . - fi + for netconf in $(echo "$NETCONFPATH"/*.conf | sort); do + export CNI_IFNAME=$(printf eth%d $i) + name=$(jq -r '.name' <"$netconf") + cniVersion=$(jq -r '.cniVersion' <"$netconf") + plist=$(jq '.plugins | select(.!=null)' <"$netconf") + if [ -n "$plist" ]; then + exec_list "$plist" "$name" "$cniVersion" + else + plugin=$(jq -r '.type' <"$netconf") + + if ! res=$($plugin <"$netconf"); then + error "$name" "$res" + elif [[ ${DEBUG} -gt 0 ]]; then + echo "${res}" | jq -r . + fi + fi - let "i=i+1" + (( i++ )) || true done } ++++++ vendor.tar.gz ++++++ ++++ 76014 lines of diff (skipped)