Add support of K8S 1.18

Change-Id: Idbde968ad1175f6a166570c9ab098d49d6a324cb
diff --git a/resources/router.yaml b/resources/router.yaml
index 142aee2..89dbf50 100644
--- a/resources/router.yaml
+++ b/resources/router.yaml
@@ -19,6 +19,7 @@
   name: core-net
 spec:
   config: '{
+    "cniVersion": "0.3.1",
     "type": "simpleovs",
     "ipam": {
         "type": "static"
@@ -31,6 +32,7 @@
   name: access-net
 spec:
   config: '{
+    "cniVersion": "0.3.1",
     "type": "simpleovs",
     "ipam": {
         "type": "static"
@@ -43,6 +45,7 @@
   name: enb-net
 spec:
   config: '{
+    "cniVersion": "0.3.1",
     "type": "simpleovs",
     "ipam": {
         "type": "static"
@@ -57,9 +60,9 @@
     app: router
   annotations:
     k8s.v1.cni.cncf.io/networks: '[
-            { "name": "core-net", "interface": "sgi-rtr", "ips": "192.168.250.1/24" },
-            { "name": "enb-net", "interface": "enb-rtr", "ips": "192.168.251.1/24" },
-            { "name": "access-net", "interface": "s1u-rtr", "ips": "192.168.252.1/24" }
+            { "name": "core-net", "interface": "core-rtr", "ips": ["192.168.250.1/24"] },
+            { "name": "enb-net", "interface": "enb-rtr", "ips": ["192.168.251.1/24"] },
+            { "name": "access-net", "interface": "access-rtr", "ips": ["192.168.252.1/24"] }
     ]'
 spec:
   containers:
diff --git a/resources/simpleovs b/resources/simpleovs
index f43b8a1..df0d975 100755
--- a/resources/simpleovs
+++ b/resources/simpleovs
@@ -60,9 +60,9 @@
 case $CNI_COMMAND in
 ADD)
 	res=$(ipam)
-	ip=$(echo $res | jq -r '.ip4.ip')
+	ip=$(echo $res | jq -r '.ips[0].address')
 	add_br_and_port $ip
-        echo '{"cniVersion":"0.2.0"}' | jq -c --arg ip $ip '.ip4.ip = $ip' >&3
+        echo '{"cniVersion":"0.3.1"}' | jq -c --arg ip $ip '.ips[0].address = $ip' >&3
 	;;
 DEL)
 	set +o errexit