| 1 | // Copyright 2020 CNI authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package mainscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/ |
| 16 | |
| 17 | import ( |
| 18 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/" |
| 19 | "fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/" |
| 20 | "netscip-go gomod github.com/golang/go/src go1.24.2 net/" |
| 21 | "stringsscip-go gomod github.com/golang/go/src go1.24.2 strings/" |
| 22 | "timescip-go gomod github.com/golang/go/src go1.24.2 time/" |
| 23 | |
| 24 | . "github.com/onsi/ginkgo/v2scip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/" |
| 25 | . "github.com/onsi/gomegascip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/" |
| 26 | "github.com/vishvananda/netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/" |
| 27 | |
| 28 | "github.com/containernetworking/cni/pkg/skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/" |
| 29 | "github.com/containernetworking/cni/pkg/typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/" |
| 30 | currentscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/ "github.com/containernetworking/cni/pkg/types/100scip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/" |
| 31 | "github.com/containernetworking/plugins/pkg/netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/" |
| 32 | "github.com/containernetworking/plugins/pkg/nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/" |
| 33 | "github.com/containernetworking/plugins/pkg/testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/" |
| 34 | ) |
| 35 | |
| 36 | func buildOneConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/buildOneConfig().(name, cniVersion string, orig *VRFNetConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/VRFNetConf#, prevResult typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.Resultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result#) (*VRFNetConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/VRFNetConf#, []byte, error) { |
| 37 | var err error |
| 38 | |
| 39 | inject := map[string]interface{}{ |
| 40 | "name": name, |
| 41 | "cniVersion": cniVersion, |
| 42 | } |
| 43 | // Add previous plugin result |
| 44 | if prevResult != nil { |
| 45 | inject["prevResult"] = prevResult |
| 46 | } |
| 47 | |
| 48 | // Ensure every config uses the same name and version |
| 49 | config := make(map[string]interface{}) |
| 50 | |
| 51 | confBytes, err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Marshal().(*orig) |
| 52 | if err != nil { |
| 53 | return nil, nil, err |
| 54 | } |
| 55 | |
| 56 | err = jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().(confBytes, &config) |
| 57 | if err != nil { |
| 58 | return nil, nil, fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Errorf().("unmarshal existing network bytes: %s", err) |
| 59 | } |
| 60 | |
| 61 | for key, value := range inject { |
| 62 | config[key] = value |
| 63 | } |
| 64 | |
| 65 | newBytes, err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Marshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Marshal().(config) |
| 66 | if err != nil { |
| 67 | return nil, nil, err |
| 68 | } |
| 69 | |
| 70 | conf := &VRFNetConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/VRFNetConf#{} |
| 71 | if err := jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().(newBytes, &conf); err != nil { |
| 72 | return nil, nil, fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Errorf().("error parsing configuration: %s", err) |
| 73 | } |
| 74 | |
| 75 | return conf, newBytes, nil |
| 76 | } |
| 77 | |
| 78 | var _ = Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("vrf plugin", func() { |
| 79 | var originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 80 | var targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS. nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS# |
| 81 | const ( |
| 82 | IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name. = "dummy0" |
| 83 | IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name. = "dummy1" |
| 84 | VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name. = "vrf0" |
| 85 | VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name. = "vrf1" |
| 86 | ) |
| 87 | |
| 88 | BeforeEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/BeforeEach().(func() { |
| 89 | var errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. error |
| 90 | originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 91 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 92 | |
| 93 | targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS., errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.NewNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/NewNS().() |
| 94 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 95 | |
| 96 | errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 97 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 98 | |
| 99 | la0 := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.NewLinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/NewLinkAttrs().() |
| 100 | la0.Namescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Name. = IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name. |
| 101 | errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAdd().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Dummyscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Dummy#{ |
| 102 | LinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Dummy#LinkAttrs.: la0, |
| 103 | }) |
| 104 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 105 | _, errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 106 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 107 | |
| 108 | la1 := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.NewLinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/NewLinkAttrs().() |
| 109 | la1.Namescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Name. = IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name. |
| 110 | errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAdd().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Dummyscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Dummy#{ |
| 111 | LinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Dummy#LinkAttrs.: la1, |
| 112 | }) |
| 113 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 114 | _, errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err. = netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 115 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 116 | return nil |
| 117 | }) |
| 118 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(errscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:err.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 119 | }) |
| 120 | |
| 121 | AfterEachscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/AfterEach().(func() { |
| 122 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 123 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Closescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Close.()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Succeedscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Succeed().()) |
| 124 | }) |
| 125 | |
| 126 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("passes prevResult through unchanged", func() { |
| 127 | conf := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24") |
| 128 | |
| 129 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 130 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 131 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 132 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 133 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf, |
| 134 | } |
| 135 | |
| 136 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 137 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 138 | |
| 139 | r, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 140 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 141 | }) |
| 142 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 143 | |
| 144 | result, err := currentscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(r) |
| 145 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 146 | |
| 147 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 148 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[0].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.)) |
| 149 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 150 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.[0].Addressscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/IPConfig#Address..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.0.0.2/24")) |
| 151 | return nil |
| 152 | }) |
| 153 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 154 | }) |
| 155 | |
| 156 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("configures a VRF and adds the interface to it", func() { |
| 157 | conf := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24") |
| 158 | |
| 159 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 160 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 161 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 162 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 163 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf, |
| 164 | } |
| 165 | |
| 166 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 167 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 168 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 169 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 170 | }) |
| 171 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 172 | return nil |
| 173 | }) |
| 174 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 175 | |
| 176 | err = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 177 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 178 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 179 | return nil |
| 180 | }) |
| 181 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 182 | }) |
| 183 | |
| 184 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("adds the interface and custom routing to new VRF", func() { |
| 185 | conf := configWithRouteForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithRouteFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24", "10.10.10.0/24") |
| 186 | |
| 187 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting custom routing first", func() { |
| 188 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 189 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 190 | |
| 191 | ipv4, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("10.0.0.2/24") |
| 192 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 193 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv4).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 194 | |
| 195 | _, routev4, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("10.10.10.0/24") |
| 196 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 197 | |
| 198 | ipv6, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("abcd:1234:ffff::cdde/64") |
| 199 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 200 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 201 | |
| 202 | _, routev6, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("1111:dddd::/80") |
| 203 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 204 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(routev6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 205 | |
| 206 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 207 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 208 | |
| 209 | // Add IP addresses for network reachability |
| 210 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv4}) |
| 211 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv6}) |
| 212 | // Wait for the corresponding route to be addeded |
| 213 | Eventuallyscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Eventually().(func() bool { |
| 214 | ipv6RouteDst := &netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPNetscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#{ |
| 215 | IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 216 | Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPMaskscip-go gomod github.com/golang/go/src go1.24.2 net/IPMask#{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
| 217 | } |
| 218 | routes, _ := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.RouteListFilteredscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/RouteListFiltered().(netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL., &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 219 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: ipv6RouteDst, |
| 220 | Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Table.: 0, |
| 221 | }, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_DSTscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_DST.|netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_TABLEscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_TABLE.) |
| 222 | return err == nil && len(routes) >= 1 |
| 223 | }, timescip-go gomod github.com/golang/go/src go1.24.2 time/.Secondscip-go gomod github.com/golang/go/src go1.24.2 time/Second., 500*timescip-go gomod github.com/golang/go/src go1.24.2 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.2 time/Millisecond.).Shouldscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/AsyncAssertion#Should().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 224 | |
| 225 | ipAddrs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_V4scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_V4.) |
| 226 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 227 | // Check if address was assigned properly |
| 228 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipAddrs[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.0.0.2")) |
| 229 | |
| 230 | // Set interface UP, otherwise local route to 10.0.0.0/24 is not present |
| 231 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkSetUpscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkSetUp().(link) |
| 232 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 233 | |
| 234 | // Add additional route to 10.10.10.0/24 via 10.0.0.1 gateway |
| 235 | r := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 236 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 237 | Srcscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Src.: ipv4.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 238 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev4, |
| 239 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("10.0.0.1"), |
| 240 | } |
| 241 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r) |
| 242 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 243 | |
| 244 | r6 := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 245 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 246 | Srcscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Src.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 247 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev6, |
| 248 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("abcd:1234:ffff::1"), |
| 249 | } |
| 250 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r6) |
| 251 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 252 | |
| 253 | return nil |
| 254 | }) |
| 255 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 256 | }) |
| 257 | |
| 258 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 259 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 260 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 261 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 262 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf, |
| 263 | } |
| 264 | |
| 265 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 266 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 267 | r, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 268 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 269 | }) |
| 270 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 271 | |
| 272 | result, err := currentscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(r) |
| 273 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 274 | |
| 275 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 276 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[0].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.)) |
| 277 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Routesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Routes.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 278 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Routesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Routes.[0].Dstscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Route#Dst..IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.10.10.0")) |
| 279 | return nil |
| 280 | }) |
| 281 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 282 | |
| 283 | err = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 284 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 285 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 286 | checkRoutesOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkRoutesOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., "10.0.0.2", "10.10.10.0/24", "1111:dddd::/80") |
| 287 | return nil |
| 288 | }) |
| 289 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 290 | }) |
| 291 | |
| 292 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("filters the correct routes to import to new VRF", func() { |
| 293 | _ = configWithRouteForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithRouteFor().("test0", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24", "10.10.10.0/24") |
| 294 | conf1 := configWithRouteForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithRouteFor().("test1", IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., "10.0.0.3/24", "10.11.10.0/24") |
| 295 | |
| 296 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting custom routing for IF0Name", func() { |
| 297 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 298 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 299 | |
| 300 | ipv4, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("10.0.0.2/24") |
| 301 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 302 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv4).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 303 | |
| 304 | _, routev4, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("10.10.10.0/24") |
| 305 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 306 | |
| 307 | ipv6, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("abcd:1234:ffff::cdde/64") |
| 308 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 309 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 310 | |
| 311 | _, routev6, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("1111:dddd::/80") |
| 312 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 313 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(routev6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 314 | |
| 315 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 316 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 317 | |
| 318 | // Add IP addresses for network reachability |
| 319 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv4}) |
| 320 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv6}) |
| 321 | // Wait for the corresponding route to be addeded |
| 322 | Eventuallyscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Eventually().(func() bool { |
| 323 | ipv6RouteDst := &netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPNetscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#{ |
| 324 | IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 325 | Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPMaskscip-go gomod github.com/golang/go/src go1.24.2 net/IPMask#{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
| 326 | } |
| 327 | routes, _ := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.RouteListFilteredscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/RouteListFiltered().(netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL., &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 328 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: ipv6RouteDst, |
| 329 | Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Table.: 0, |
| 330 | }, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_DSTscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_DST.|netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_TABLEscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_TABLE.) |
| 331 | return err == nil && len(routes) >= 1 |
| 332 | }, timescip-go gomod github.com/golang/go/src go1.24.2 time/.Secondscip-go gomod github.com/golang/go/src go1.24.2 time/Second., 500*timescip-go gomod github.com/golang/go/src go1.24.2 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.2 time/Millisecond.).Shouldscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/AsyncAssertion#Should().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 333 | |
| 334 | ipAddrs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_V4scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_V4.) |
| 335 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 336 | // Check if address was assigned properly |
| 337 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipAddrs[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.0.0.2")) |
| 338 | |
| 339 | // Set interface UP, otherwise local route to 10.0.0.0/24 is not present |
| 340 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkSetUpscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkSetUp().(link) |
| 341 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 342 | |
| 343 | // Add additional route to 10.10.10.0/24 via 10.0.0.1 gateway |
| 344 | r := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 345 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 346 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev4, |
| 347 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("10.0.0.1"), |
| 348 | } |
| 349 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r) |
| 350 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 351 | |
| 352 | r6 := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 353 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 354 | Srcscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Src.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 355 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev6, |
| 356 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("abcd:1234:ffff::1"), |
| 357 | } |
| 358 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r6) |
| 359 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 360 | |
| 361 | return nil |
| 362 | }) |
| 363 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 364 | }) |
| 365 | |
| 366 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting custom routing for IF1Name", func() { |
| 367 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 368 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 369 | |
| 370 | ipv4, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("10.0.0.3/24") |
| 371 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 372 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv4).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 373 | |
| 374 | _, routev4, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("10.11.10.0/24") |
| 375 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 376 | |
| 377 | ipv6, err := typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.ParseCIDRscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/ParseCIDR().("abcd:1234:ffff::cddf/64") |
| 378 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 379 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipv6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 380 | |
| 381 | _, routev6, err := netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseCIDRscip-go gomod github.com/golang/go/src go1.24.2 net/ParseCIDR().("1111:ddde::/80") |
| 382 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 383 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(routev6).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(BeNilscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeNil().()) |
| 384 | |
| 385 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 386 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 387 | |
| 388 | // Add IP addresses for network reachability |
| 389 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv4}) |
| 390 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(link, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Addrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#{IPNetscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Addr#IPNet.: ipv6}) |
| 391 | // Wait for the corresponding route to be addeded |
| 392 | Eventuallyscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Eventually().(func() bool { |
| 393 | ipv6RouteDst := &netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPNetscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#{ |
| 394 | IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 395 | Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.IPMaskscip-go gomod github.com/golang/go/src go1.24.2 net/IPMask#{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
| 396 | } |
| 397 | routes, _ := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.RouteListFilteredscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/RouteListFiltered().(netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL., &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 398 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: ipv6RouteDst, |
| 399 | Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Table.: 0, |
| 400 | }, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_DSTscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_DST.|netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_TABLEscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_TABLE.) |
| 401 | return err == nil && len(routes) >= 1 |
| 402 | }, timescip-go gomod github.com/golang/go/src go1.24.2 time/.Secondscip-go gomod github.com/golang/go/src go1.24.2 time/Second., 500*timescip-go gomod github.com/golang/go/src go1.24.2 time/.Millisecondscip-go gomod github.com/golang/go/src go1.24.2 time/Millisecond.).Shouldscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/AsyncAssertion#Should().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 403 | |
| 404 | ipAddrs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_V4scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_V4.) |
| 405 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 406 | // Check if address was assigned properly |
| 407 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipAddrs[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.0.0.3")) |
| 408 | |
| 409 | // Set interface UP, otherwise local route to 10.0.0.0/24 is not present |
| 410 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkSetUpscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkSetUp().(link) |
| 411 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 412 | |
| 413 | // Add additional route to 10.11.10.0/24 via 10.0.0.1 gateway |
| 414 | r := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 415 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 416 | Srcscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Src.: ipv4.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 417 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev4, |
| 418 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("10.0.0.1"), |
| 419 | Priorityscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Priority.: 100, |
| 420 | } |
| 421 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r) |
| 422 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 423 | |
| 424 | r6 := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 425 | LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.: link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index., |
| 426 | Srcscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Src.: ipv6.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP., |
| 427 | Dstscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Dst.: routev6, |
| 428 | Gwscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Gw.: netscip-go gomod github.com/golang/go/src go1.24.2 net/.ParseIPscip-go gomod github.com/golang/go/src go1.24.2 net/ParseIP().("abcd:1234:ffff::1"), |
| 429 | } |
| 430 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RouteAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RouteAdd().(&r6) |
| 431 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 432 | |
| 433 | return nil |
| 434 | }) |
| 435 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 436 | }) |
| 437 | |
| 438 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding if1 to the VRF", func() { |
| 439 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 440 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 441 | |
| 442 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 443 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 444 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 445 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., |
| 446 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf1, |
| 447 | } |
| 448 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 449 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 450 | }) |
| 451 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 452 | |
| 453 | return nil |
| 454 | }) |
| 455 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 456 | }) |
| 457 | |
| 458 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking routes are moved correctly to VRF", func() { |
| 459 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 460 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 461 | |
| 462 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 463 | checkRoutesOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkRoutesOnVRF().(VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., "10.0.0.3", "10.11.10.0/24", "1111:ddde::/80") |
| 464 | |
| 465 | return nil |
| 466 | }) |
| 467 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 468 | }) |
| 469 | }) |
| 470 | |
| 471 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("fails if the interface already has a master set", func() { |
| 472 | conf := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24") |
| 473 | |
| 474 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting the interface's master", func() { |
| 475 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 476 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 477 | l, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 478 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 479 | linkAttrs := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.NewLinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/NewLinkAttrs().() |
| 480 | linkAttrs.Namescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Name. = "testrbridge" |
| 481 | br := &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Bridgescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Bridge#{ |
| 482 | LinkAttrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Bridge#LinkAttrs.: linkAttrs, |
| 483 | } |
| 484 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAdd().(br) |
| 485 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 486 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkSetMasterscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkSetMaster().(l, br) |
| 487 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 488 | return nil |
| 489 | }) |
| 490 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 491 | }) |
| 492 | |
| 493 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 494 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 495 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 496 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 497 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf, |
| 498 | } |
| 499 | |
| 500 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 501 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 502 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 503 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 504 | }) |
| 505 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 506 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err.Error()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(ContainSubstringscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/ContainSubstring().("has already a master set")) |
| 507 | return nil |
| 508 | }) |
| 509 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 510 | }) |
| 511 | |
| 512 | DescribeTablescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/DescribeTable().("handles two interfaces", |
| 513 | func(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1., ip0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip0., ip1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip1. string) { |
| 514 | conf0 := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., ip0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip0.) |
| 515 | conf1 := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test1", IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1., ip1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip1.) |
| 516 | |
| 517 | addr0, err := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.ParseAddrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/ParseAddr().(ip0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip0.) |
| 518 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 519 | addr1, err := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.ParseAddrscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/ParseAddr().(ip1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:ip1.) |
| 520 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 521 | |
| 522 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting the first interface's ip", func() { |
| 523 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 524 | l, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 525 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 526 | |
| 527 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(l, addr0) |
| 528 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 529 | |
| 530 | return nil |
| 531 | }) |
| 532 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 533 | }) |
| 534 | |
| 535 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding the first interface to first vrf", func() { |
| 536 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 537 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 538 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 539 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 540 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 541 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 542 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf0, |
| 543 | } |
| 544 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 545 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 546 | }) |
| 547 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 548 | return nil |
| 549 | }) |
| 550 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 551 | }) |
| 552 | |
| 553 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Setting the second interface's ip", func() { |
| 554 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 555 | l, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 556 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 557 | |
| 558 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.AddrAddscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/AddrAdd().(l, addr1) |
| 559 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 560 | return nil |
| 561 | }) |
| 562 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 563 | }) |
| 564 | |
| 565 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding the second interface to second vrf", func() { |
| 566 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 567 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 568 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 569 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 570 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 571 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., |
| 572 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf1, |
| 573 | } |
| 574 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 575 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 576 | }) |
| 577 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 578 | return nil |
| 579 | }) |
| 580 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 581 | }) |
| 582 | |
| 583 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the first interface is added to first vrf", func() { |
| 584 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 585 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 586 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 587 | |
| 588 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 589 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 590 | addresses, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL.) |
| 591 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 592 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 593 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Equalscip-go gomod github.com/golang/go/src go1.24.2 net/IP#Equal().(addr0.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 594 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses[0].Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(addr0.Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.)) |
| 595 | return nil |
| 596 | }) |
| 597 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 598 | }) |
| 599 | |
| 600 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the second interface is added to second vrf", func() { |
| 601 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 602 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 603 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 604 | |
| 605 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 606 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 607 | |
| 608 | addresses, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL.) |
| 609 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 610 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 611 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Equalscip-go gomod github.com/golang/go/src go1.24.2 net/IP#Equal().(addr1.IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 612 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(addresses[0].Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(addr1.Maskscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#Mask.)) |
| 613 | return nil |
| 614 | }) |
| 615 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 616 | }) |
| 617 | |
| 618 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that when the vrfs are different, the routing table is different", func() { |
| 619 | if vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0. == vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1. { |
| 620 | return |
| 621 | } |
| 622 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 623 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 624 | l0, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0.) |
| 625 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 626 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(l0).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{})) |
| 627 | l1, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1.) |
| 628 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 629 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(l1).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{})) |
| 630 | |
| 631 | vrf0Link := l0.(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#) |
| 632 | vrf1Link := l1.(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#) |
| 633 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(vrf0Link.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(vrf1Link.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.)) |
| 634 | return nil |
| 635 | }) |
| 636 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 637 | }) |
| 638 | }, |
| 639 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to the same vrf", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24", "10.0.0.3/24"), |
| 640 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to different vrfs", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., "10.0.0.2/24", "10.0.0.3/24"), |
| 641 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to different vrfs with same ip", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., "10.0.0.2/24", "10.0.0.2/24"), |
| 642 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to the same vrf IPV6", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "2A00:0C98:2060:A000:0001:0000:1d1e:ca75/64", "2A00:0C98:2060:A000:0001:0000:1d1e:ca76/64"), |
| 643 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to different vrfs IPV6", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., "2A00:0C98:2060:A000:0001:0000:1d1e:ca75/64", "2A00:0C98:2060:A000:0001:0000:1d1e:ca76/64"), |
| 644 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("added to different vrfs with same ip IPV6", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., "2A00:0C98:2060:A000:0001:0000:1d1e:ca75/64", "2A00:0C98:2060:A000:0001:0000:1d1e:ca75/64"), |
| 645 | ) |
| 646 | |
| 647 | DescribeTablescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/DescribeTable().("handles tableid conflicts", |
| 648 | func(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1. string, tableid0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:tableid0., tableid1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:tableid1. int, expectedErrorscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expectedError. string) { |
| 649 | conf0 := configWithTableForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithTableFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0., "10.0.0.2/24", tableid0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:tableid0.) |
| 650 | conf1 := configWithTableForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithTableFor().("test1", IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., vrf1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf1., "10.0.0.2/24", tableid1scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:tableid1.) |
| 651 | |
| 652 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding the first interface to first vrf", func() { |
| 653 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 654 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 655 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 656 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 657 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 658 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 659 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf0, |
| 660 | } |
| 661 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 662 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 663 | }) |
| 664 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 665 | return nil |
| 666 | }) |
| 667 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 668 | }) |
| 669 | |
| 670 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the first vrf has the right routing table", func() { |
| 671 | err := targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 672 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 673 | |
| 674 | l, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(vrf0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:vrf0.) |
| 675 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 676 | vrf := l.(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#) |
| 677 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(vrf.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(uint32(tableid0scip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:tableid0.))) |
| 678 | return nil |
| 679 | }) |
| 680 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 681 | }) |
| 682 | |
| 683 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding the second interface to second vrf", func() { |
| 684 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 685 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 686 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 687 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 688 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 689 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., |
| 690 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf1, |
| 691 | } |
| 692 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 693 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 694 | }) |
| 695 | return err |
| 696 | }) |
| 697 | if expectedErrorscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expectedError. != "" { |
| 698 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 699 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err.Error()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(ContainSubstringscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/ContainSubstring().(expectedErrorscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expectedError.)) |
| 700 | return |
| 701 | } |
| 702 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 703 | }) |
| 704 | }, |
| 705 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("same vrf with same tableid", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., 1001, 1001, ""), |
| 706 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("different vrf with same tableid", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF1Name., 1001, 1001, ""), |
| 707 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("same vrf with different tableids", VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., 1001, 1002, "already exist with different routing table"), |
| 708 | ) |
| 709 | |
| 710 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("removes the VRF only when the last interface is removed", func() { |
| 711 | conf0 := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test", IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24") |
| 712 | conf1 := configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().("test1", IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., "10.0.0.2/24") |
| 713 | |
| 714 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Adding the two interfaces to the VRF", func() { |
| 715 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 716 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 717 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 718 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 719 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 720 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 721 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf0, |
| 722 | } |
| 723 | _, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 724 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 725 | }) |
| 726 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 727 | |
| 728 | args = &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 729 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 730 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 731 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., |
| 732 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf1, |
| 733 | } |
| 734 | _, _, err = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 735 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 736 | }) |
| 737 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 738 | return nil |
| 739 | }) |
| 740 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 741 | }) |
| 742 | |
| 743 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the two interfaces are added to the VRF", func() { |
| 744 | targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 745 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 746 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 747 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 748 | return nil |
| 749 | }) |
| 750 | }) |
| 751 | |
| 752 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Removing the first interface from VRF, removing the interface", func() { |
| 753 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 754 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 755 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 756 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 757 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 758 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 759 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf0, |
| 760 | } |
| 761 | err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdDelWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdDelWithArgs().(args, func() error { |
| 762 | return cmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdDel().(args) |
| 763 | }) |
| 764 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 765 | return nil |
| 766 | }) |
| 767 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 768 | |
| 769 | err = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 770 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 771 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 772 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkDelscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkDel().(link) |
| 773 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 774 | return nil |
| 775 | }) |
| 776 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 777 | }) |
| 778 | |
| 779 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the second interface is still on the VRF and that VRF still exists", func() { |
| 780 | targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 781 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 782 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 783 | return nil |
| 784 | }) |
| 785 | }) |
| 786 | |
| 787 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Removing the second interface from VRF, deleting the second interface", func() { |
| 788 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 789 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 790 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 791 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 792 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 793 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name., |
| 794 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf1, |
| 795 | } |
| 796 | err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdDelWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdDelWithArgs().(args, func() error { |
| 797 | return cmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdDel().(args) |
| 798 | }) |
| 799 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 800 | return nil |
| 801 | }) |
| 802 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 803 | |
| 804 | err = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 805 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(IF1Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF1Name.) |
| 806 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 807 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkDelscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkDel().(link) |
| 808 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 809 | return nil |
| 810 | }) |
| 811 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 812 | }) |
| 813 | |
| 814 | Byscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/By().("Checking that the VRF is removed", func() { |
| 815 | targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 816 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 817 | _, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name.) |
| 818 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 819 | return nil |
| 820 | }) |
| 821 | }) |
| 822 | }) |
| 823 | |
| 824 | Itscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/It().("configures and deconfigures VRF with CNI 0.4.0 ADD/DEL", func() { |
| 825 | conf := []byte(fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 826 | "name": "test", |
| 827 | "type": "vrf", |
| 828 | "cniVersion": "0.4.0", |
| 829 | "vrfName": "%s", |
| 830 | "prevResult": { |
| 831 | "interfaces": [ |
| 832 | {"name": "%s", "sandbox":"netns"} |
| 833 | ], |
| 834 | "ips": [ |
| 835 | { |
| 836 | "version": "4", |
| 837 | "address": "10.0.0.2/24", |
| 838 | "gateway": "10.0.0.1", |
| 839 | "interface": 0 |
| 840 | } |
| 841 | ] |
| 842 | } |
| 843 | }`, VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.)) |
| 844 | |
| 845 | args := &skelscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/.CmdArgsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#{ |
| 846 | ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID.: "dummy", |
| 847 | Netnsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#Netns.: targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 848 | IfNamescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#IfName.: IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name., |
| 849 | StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData.: conf, |
| 850 | } |
| 851 | var prevResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:prevRes. typesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/.Resultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types`/Result# |
| 852 | err := originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 853 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 854 | |
| 855 | prevRes, _, err := testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdAddWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdAddWithArgs().(args, func() error { |
| 856 | return cmdAddscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdAdd().(args) |
| 857 | }) |
| 858 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 859 | |
| 860 | result, err := currentscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/.GetResultscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/GetResult().(prevRes) |
| 861 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 862 | |
| 863 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 864 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.Interfacesscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#Interfaces.[0].Namescip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Interface#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.)) |
| 865 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 866 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(result.IPsscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/Result#IPs.[0].Addressscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/types/100`/IPConfig#Address..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().("10.0.0.2/24")) |
| 867 | return nil |
| 868 | }) |
| 869 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 870 | |
| 871 | err = targetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:targetNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 872 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 873 | checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(VRF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:VRF0Name., IF0Namescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:IF0Name.) |
| 874 | return nil |
| 875 | }) |
| 876 | |
| 877 | err = originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Doscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Do.(func(nsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/.NetNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#) error { |
| 878 | defer GinkgoRecoverscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/GinkgoRecover().() |
| 879 | cniVersion := "0.4.0" |
| 880 | n := &VRFNetConfscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/VRFNetConf#{} |
| 881 | err = jsonscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/.Unmarshalscip-go gomod github.com/golang/go/src go1.24.2 `encoding/json`/Unmarshal().(conf, &n) |
| 882 | _, confString, err := buildOneConfigscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/buildOneConfig().("testConfig", cniVersion, n, prevResscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:prevRes.) |
| 883 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 884 | |
| 885 | args.StdinDatascip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#StdinData. = confString |
| 886 | |
| 887 | err = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdCheckWithArgsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdCheckWithArgs().(args, func() error { |
| 888 | return cmdCheckscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdCheck().(args) |
| 889 | }) |
| 890 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 891 | |
| 892 | err = testutilsscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/.CmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/testutils`/CmdDel().(originalNSscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:originalNS..Pathscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/ns`/NetNS#Path.(), |
| 893 | args.ContainerIDscip-go gomod github.com/containernetworking/cni v1.3.0 `github.com/containernetworking/cni/pkg/skel`/CmdArgs#ContainerID., "", func() error { return cmdDelscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/cmdDel().(args) }) |
| 894 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 895 | |
| 896 | return nil |
| 897 | }) |
| 898 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 899 | }) |
| 900 | }) |
| 901 | |
| 902 | var _ = Describescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Describe().("unit tests", func() { |
| 903 | DescribeTablescip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/DescribeTable().("When looking for a table id", |
| 904 | func(linksscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:links. []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#, expectedscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expected. uint32, expectFailscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expectFail. bool) { |
| 905 | newID, err := findFreeRoutingTableIDscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/findFreeRoutingTableID().(linksscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:links.) |
| 906 | if expectFailscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expectFail. { |
| 907 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 908 | return |
| 909 | } |
| 910 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 911 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(newID).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(expectedscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/_:expected.)) |
| 912 | }, |
| 913 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("Finds first free one", []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#{ |
| 914 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 1}, |
| 915 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 2}, |
| 916 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 3}, |
| 917 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 5}, |
| 918 | }, uint32(4), false), |
| 919 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("Ignores non VRFs free one", []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#{ |
| 920 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 1}, |
| 921 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 2}, |
| 922 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Dummyscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Dummy#{}, |
| 923 | &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: 5}, |
| 924 | }, uint32(3), false), |
| 925 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("Takes the first when no vrfs are there", []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#{}, |
| 926 | uint32(1), false), |
| 927 | Entryscip-go gomod github.com/onsi/ginkgo/v2 v2.25.1 `github.com/onsi/ginkgo/v2`/Entry().("Works with 999 vrfs already assigned", func() []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link# { |
| 928 | res := []netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Linkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#{} |
| 929 | for i := uint32(1); i < 1000; i++ { |
| 930 | res = append(res, &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.: i}) |
| 931 | } |
| 932 | return res |
| 933 | }(), uint32(1000), false), |
| 934 | ) |
| 935 | }) |
| 936 | |
| 937 | func configForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configFor().(name, intf, vrf, ip string) []byte { |
| 938 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 939 | "name": "%s", |
| 940 | "type": "vrf", |
| 941 | "cniVersion": "0.3.1", |
| 942 | "vrfName": "%s", |
| 943 | "prevResult": { |
| 944 | "interfaces": [ |
| 945 | {"name": "%s", "sandbox":"netns"} |
| 946 | ], |
| 947 | "ips": [ |
| 948 | { |
| 949 | "version": "4", |
| 950 | "address": "%s", |
| 951 | "gateway": "10.0.0.1", |
| 952 | "interface": 0 |
| 953 | } |
| 954 | ] |
| 955 | } |
| 956 | }`, name, vrf, intf, ip) |
| 957 | return []byte(conf) |
| 958 | } |
| 959 | |
| 960 | func configWithTableForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithTableFor().(name, intf, vrf, ip string, tableID int) []byte { |
| 961 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 962 | "name": "%s", |
| 963 | "type": "vrf", |
| 964 | "cniVersion": "0.3.1", |
| 965 | "vrfName": "%s", |
| 966 | "table": %d, |
| 967 | "prevResult": { |
| 968 | "interfaces": [ |
| 969 | {"name": "%s", "sandbox":"netns"} |
| 970 | ], |
| 971 | "ips": [ |
| 972 | { |
| 973 | "version": "4", |
| 974 | "address": "%s", |
| 975 | "gateway": "10.0.0.1", |
| 976 | "interface": 0 |
| 977 | } |
| 978 | ] |
| 979 | } |
| 980 | }`, name, vrf, tableID, intf, ip) |
| 981 | return []byte(conf) |
| 982 | } |
| 983 | |
| 984 | func configWithRouteForscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/configWithRouteFor().(name, intf, vrf, ip, route string) []byte { |
| 985 | conf := fmtscip-go gomod github.com/golang/go/src go1.24.2 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.24.2 fmt/Sprintf().(`{ |
| 986 | "name": "%s", |
| 987 | "type": "vrf", |
| 988 | "cniVersion": "0.3.1", |
| 989 | "vrfName": "%s", |
| 990 | "prevResult": { |
| 991 | "interfaces": [ |
| 992 | {"name": "%s", "sandbox":"netns"} |
| 993 | ], |
| 994 | "ips": [ |
| 995 | { |
| 996 | "version": "4", |
| 997 | "address": "%s", |
| 998 | "gateway": "10.0.0.1", |
| 999 | "interface": 0 |
| 1000 | } |
| 1001 | ], |
| 1002 | "routes": [ |
| 1003 | { |
| 1004 | "dst": "%s", |
| 1005 | "gw": "10.0.0.1" |
| 1006 | } |
| 1007 | ] |
| 1008 | } |
| 1009 | }`, name, vrf, intf, ip, route) |
| 1010 | return []byte(conf) |
| 1011 | } |
| 1012 | |
| 1013 | func checkInterfaceOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkInterfaceOnVRF().(vrfName, intfName string) { |
| 1014 | vrf, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(vrfName) |
| 1015 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1016 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(vrf).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{})) |
| 1017 | |
| 1018 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(intfName) |
| 1019 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1020 | masterIndx := link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().MasterIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#MasterIndex. |
| 1021 | master, err := netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkByIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkByIndex().(masterIndx) |
| 1022 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1023 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(master.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Namescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Name.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(vrfName)) |
| 1024 | } |
| 1025 | |
| 1026 | func checkRoutesOnVRFscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/plugins/meta/vrf`/checkRoutesOnVRF().(vrfName, intfName string, addrStr string, routesToCheck ...string) { |
| 1027 | l, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(vrfName) |
| 1028 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1029 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(l).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeAssignableToTypeOfscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeAssignableToTypeOf().(&netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#{})) |
| 1030 | |
| 1031 | vrf, ok := l.(*netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Vrfscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#) |
| 1032 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ok).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(BeTruescip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/BeTrue().()) |
| 1033 | |
| 1034 | link, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.LinkByNamescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/LinkByName().(intfName) |
| 1035 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1036 | |
| 1037 | err = netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.LinkSetUpscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkSetUp().(link) |
| 1038 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1039 | |
| 1040 | ipAddrs, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.AddrListscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/AddrList().(link, netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_V4scip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_V4.) |
| 1041 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1042 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipAddrs).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(HaveLenscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveLen().(1)) |
| 1043 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(ipAddrs[0].IPscip-go gomod github.com/golang/go/src go1.24.2 net/IPNet#IP..Stringscip-go gomod github.com/golang/go/src go1.24.2 net/IP#String().()).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(addrStr)) |
| 1044 | |
| 1045 | routeFilter := &netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.Routescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#{ |
| 1046 | Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Table.: int(vrf.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.), |
| 1047 | } |
| 1048 | |
| 1049 | routes, err := netlinksafescip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/.RouteListFilteredscip-go gomod github.com/containernetworking/plugins . `github.com/containernetworking/plugins/pkg/netlinksafe`/RouteListFiltered().(netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.FAMILY_ALLscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/FAMILY_ALL., |
| 1050 | routeFilter, |
| 1051 | netlinkscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/.RT_FILTER_TABLEscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/RT_FILTER_TABLE.) |
| 1052 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(err).NotToscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(HaveOccurredscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/HaveOccurred().()) |
| 1053 | |
| 1054 | routesRead := []string{} |
| 1055 | for _, route := range routes { |
| 1056 | routesRead = append(routesRead, route.Stringscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#String().()) |
| 1057 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(uint32(route.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#Table.)).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(vrf.Tablescip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Vrf#Table.)) |
| 1058 | } |
| 1059 | routesStr := stringsscip-go gomod github.com/golang/go/src go1.24.2 strings/.Joinscip-go gomod github.com/golang/go/src go1.24.2 strings/Join().(routesRead, "\n") |
| 1060 | for _, route := range routesToCheck { |
| 1061 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(routesStr).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(ContainSubstringscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/ContainSubstring().(route)) |
| 1062 | } |
| 1063 | |
| 1064 | for _, route := range routes { |
| 1065 | Expectscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Expect().(route.LinkIndexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Route#LinkIndex.).Toscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega/types`/Assertion#To().(Equalscip-go gomod github.com/onsi/gomega v1.38.1 `github.com/onsi/gomega`/Equal().(link.Attrsscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/Link#Attrs().().Indexscip-go gomod github.com/vishvananda/netlink v1.3.1 `github.com/vishvananda/netlink`/LinkAttrs#Index.)) |
| 1066 | } |
| 1067 | } |