updated anycast plugin to current master
authorMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 15:15:34 +0000 (15:15 +0000)
committerMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 15:15:34 +0000 (15:15 +0000)
plugins/anycast/main.go

index 01f8f8d..3fe560f 100644 (file)
@@ -26,7 +26,7 @@ import (
        "github.com/containernetworking/cni/pkg/types/current"
        "github.com/containernetworking/cni/pkg/version"
 
-       "github.com/containernetworking/cni/pkg/ns"
+       "github.com/containernetworking/plugins/pkg/ns"
        "github.com/vishvananda/netlink"
        "log"
        "os"
@@ -117,7 +117,10 @@ func cmdAdd(args *skel.CmdArgs) error {
                }
        } else {
                for _, ip := range conf.PrevResult.IPs {
-                       intIdx := ip.Interface
+                       if ip.Interface == nil {
+                               continue
+                       }
+                       intIdx := *ip.Interface
                        // Every IP is indexed in to the interfaces array, with "-1" standing
                        // for an unknown interface (which we'll assume to be Container-side
                        // Skip all IPs we know belong to an interface with the wrong name.