Deal with mesos not supporting CNI_ARGS
authorMichael Cambria <michael.cambria@verizon.com>
Mon, 20 Feb 2017 17:18:17 +0000 (12:18 -0500)
committerMichael Cambria <michael.cambria@verizon.com>
Mon, 20 Feb 2017 17:18:17 +0000 (12:18 -0500)
20-macvlan0.conf
cni-quagga-bgp.txt
mcc-manual-add-static-env.sh
mcc-manual-del-static-env.sh
plugins/ipam/vz-local/backend/allocator/config.go

index 6e219fa..67a8d85 100644 (file)
@@ -13,6 +13,7 @@
               { "key" : "mccKey1", "value" : "mccVal1" },
               { "key" : "bs", "value" : "bsVal" },
               { "key" : "StaticIP", "value" : "172.19.0.209" },
+              { "key" : "viaIP", "value" : "eth1p0" },
               { "key" : "mccKey2", "value" : "mccVal2" },
               { "key" : "env", "value" : "prod" }
             ]
index 6af686c..afb04c0 100644 (file)
@@ -13,4 +13,18 @@ sudo ip netns exec mcc-cni-test1 /bin/bash
 
 /var/lib/cni/networks/
 
+vtysh 2506
+node-36-20# show ip bgp 
+BGP table version is 0, local router ID is 10.36.20.1
+Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
+              i internal, r RIB-failure, S Stale, R Removed
+Origin codes: i - IGP, e - EGP, ? - incomplete
+
+   Network          Next Hop            Metric LocPrf Weight Path
+*  0.0.0.0          169.254.0.2                            0 64513 65531 i
+*>                  169.254.0.1                            0 64512 65531 i
+*> 198.159.134.4/32 0.0.0.0                  0          32768 i
+*> 198.159.134.33/32
+                    0.0.0.0                  0          32768 i
+
 
index bb084a5..cfc47ab 100755 (executable)
@@ -8,7 +8,7 @@ export CNI_COMMAND=ADD
 export CNI_NETNS=/var/run/netns/mcc-cni-test0
 export CNI_CONTAINERID=mcc-cni-test0 
 
-export CNI_ARGS="IP=172.19.99.99;UPLINK=eth1p0"
+##export CNI_ARGS="IP=172.19.99.99;UPLINK=eth1p0"
 #export CNI_ARGS="IP=172.19.99.99"
 #export CNI_ARGS+=";UPLINK=cbr0"
 
index 84af1c2..83bbd05 100755 (executable)
@@ -8,7 +8,7 @@ export CNI_COMMAND=DEL
 export CNI_NETNS=/var/run/netns/mcc-cni-test0
 export CNI_CONTAINERID=mcc-cni-test0 
 
-export CNI_ARGS="IP=172.19.99.99;UPLINK=eth1p0"
+##export CNI_ARGS="IP=172.19.99.99;UPLINK=eth1p0"
 #export CNI_ARGS="IP=172.19.99.99"
 #export CNI_ARGS+=";UPLINK=cbr0"
 
index e4ef561..ad95ce6 100644 (file)
@@ -91,8 +91,11 @@ func LoadIPAMConfig(bytes []byte, args string) (*IPAMConfig, string, error) {
                return nil, "", err
        }
 
+       // MikeC for now 
+       n.IPAM.Args = &IPAMArgs{}
        if args != "" {
-               n.IPAM.Args = &IPAMArgs{}
+               // MikeC for now 
+               // n.IPAM.Args = &IPAMArgs{}
                err := types.LoadArgs(args, n.IPAM.Args)
                if err != nil {
                        return nil, "", err
@@ -159,6 +162,18 @@ func LoadIPAMConfig(bytes []byte, args string) (*IPAMConfig, string, error) {
            println("StaticIP label NOT set")
        }
 
+        viaIP, found := labels["viaIP"]
+        if found {
+           println("viaIP is: ", viaIP)
+           log.Println("viaIP is: ", viaIP)
+           n.IPAM.Args.UPLINK= types.UnmarshallableString(viaIP)
+           log.Println("IPAM args: n.IPAM.UPLINK is:", n.IPAM.Args.UPLINK)
+        } else {
+           println("viaIP label NOT set")
+        }
+
+
+
         bull, found := labels["bull"]
         if !found {
            println("Hard to believe, but bull not found")