Skip to content

Commit

Permalink
Update CNI network plugin dependency. (#33768)
Browse files Browse the repository at this point in the history
  • Loading branch information
bianpengyuan authored Jul 1, 2021
1 parent 70e42c6 commit a931d45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
15 changes: 2 additions & 13 deletions cni/cmd/istio-cni/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"istio.io/api/annotation"
"istio.io/pkg/log"
istioversion "istio.io/pkg/version"
)

var (
Expand Down Expand Up @@ -276,24 +277,12 @@ func cmdAdd(args *skel.CmdArgs) (err error) {
return types.PrintResult(result, conf.CNIVersion)
}

func cmdGet(args *skel.CmdArgs) error {
log.Info("cmdGet not implemented")
// TODO: implement
return fmt.Errorf("not implemented")
}

// cmdDel is called for DELETE requests
func cmdDel(args *skel.CmdArgs) error {
// nothing to cleanup for istio-cni
return nil
}

func main() {
loggingOptions.OutputPaths = []string{"stderr"}
loggingOptions.JSONEncoding = true
if err := log.Configure(loggingOptions); err != nil {
os.Exit(1)
}
// TODO: implement plugin version
skel.PluginMain(cmdAdd, cmdGet, cmdDel, version.All, "istio-cni")
skel.PluginMain(cmdAdd, nil, nil, version.All, fmt.Sprintf("CNI plugin istio-cni %v", istioversion.Info.Version))
}
4 changes: 2 additions & 2 deletions cni/cmd/istio-cni/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func testCmdInvalidVersion(t *testing.T, f func(args *skel.CmdArgs) error) {

err := f(args)
if err != nil {
if !strings.Contains(err.Error(), "could not convert result to current version") {
t.Fatalf("expected substring error 'could not convert result to current version', got: %v", err)
if !strings.Contains(err.Error(), "cannot convert: no valid IP addresses") {
t.Fatalf("expected substring error 'cannot convert: no valid IP addresses', got: %v", err)
}
} else {
t.Fatalf("expected failed CNI version, got: no error")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/cheggaaa/pb/v3 v3.0.8
github.com/cncf/udpa/go v0.0.0-20210322005330-6414d713912e
github.com/cncf/xds/go v0.0.0-20210323124008-b88cc788a63e
github.com/containernetworking/cni v0.7.0-alpha1
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.7.3
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/davecgh/go-spew v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv
github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
github.com/containernetworking/cni v0.7.0-alpha1 h1:a3TVZWNd0f5Ml+l8CQC/KzzbGBVP96wXHIft1QgvWuQ=
github.com/containernetworking/cni v0.7.0-alpha1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/cni v0.8.1 h1:7zpDnQ3T3s4ucOuJ/ZCLrYBxzkg0AELFfII3Epo9TmI=
github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY=
github.com/containernetworking/plugins v0.7.3 h1:cj32EM6IBzyqbx+qyB7Tz3lWMVtEHQJKfECNdhwZkFk=
github.com/containernetworking/plugins v0.7.3/go.mod h1:dagHaAhNjXjT9QYOklkKJDGaQPTg4pf//FrUcJeb7FU=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down

0 comments on commit a931d45

Please sign in to comment.