Bumpup kubernetes client from 4.7.1 to 5.0.0 (support up to kubernetes 1.19)

Change-Id: I7555325fd5eee5bbbb7a0a7a5c27bfc2c333fc7f
diff --git a/apps/k8s-networking/BUILD b/apps/k8s-networking/BUILD
index 9729e56..a4c4f0e 100644
--- a/apps/k8s-networking/BUILD
+++ b/apps/k8s-networking/BUILD
@@ -6,6 +6,26 @@
     "@json//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
diff --git a/apps/k8s-networking/api/BUILD b/apps/k8s-networking/api/BUILD
index e1e477c..e9ba8dd 100644
--- a/apps/k8s-networking/api/BUILD
+++ b/apps/k8s-networking/api/BUILD
@@ -1,6 +1,26 @@
 COMPILE_DEPS = CORE_DEPS + [
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
diff --git a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyAdminService.java b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyAdminService.java
index 2c5bb48..1e87322 100644
--- a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyAdminService.java
+++ b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyAdminService.java
@@ -15,7 +15,8 @@
  */
 package org.onosproject.k8snetworking.api;
 
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 
 /**
  * Service for administering the inventory of kubernetes network policy.
diff --git a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyEvent.java b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyEvent.java
index 28c502f..5731cf3 100644
--- a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyEvent.java
+++ b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyEvent.java
@@ -15,7 +15,7 @@
  */
 package org.onosproject.k8snetworking.api;
 
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import org.onosproject.event.AbstractEvent;
 
 /**
diff --git a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyService.java b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyService.java
index 5c3e572..c5d9957 100644
--- a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyService.java
+++ b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyService.java
@@ -15,7 +15,7 @@
  */
 package org.onosproject.k8snetworking.api;
 
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import org.onosproject.event.ListenerService;
 
 import java.util.Set;
diff --git a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyStore.java b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyStore.java
index c6250ae..e283c37 100644
--- a/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyStore.java
+++ b/apps/k8s-networking/api/src/main/java/org/onosproject/k8snetworking/api/K8sNetworkPolicyStore.java
@@ -15,7 +15,7 @@
  */
 package org.onosproject.k8snetworking.api;
 
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import org.onosproject.store.Store;
 
 import java.util.Set;
diff --git a/apps/k8s-networking/app/BUILD b/apps/k8s-networking/app/BUILD
index 87c974e..5193826 100644
--- a/apps/k8s-networking/app/BUILD
+++ b/apps/k8s-networking/app/BUILD
@@ -9,6 +9,26 @@
     "@json//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sNetworkPolicyListCommand.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sNetworkPolicyListCommand.java
index ffc76d7..f86db47 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sNetworkPolicyListCommand.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sNetworkPolicyListCommand.java
@@ -20,7 +20,7 @@
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import io.fabric8.kubernetes.client.utils.Serialization;
 import org.apache.commons.lang.StringUtils;
 import org.apache.karaf.shell.api.action.Command;
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sSyncStateCommand.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sSyncStateCommand.java
index a466e14..843c2f8 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sSyncStateCommand.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/cli/K8sSyncStateCommand.java
@@ -21,7 +21,7 @@
 import io.fabric8.kubernetes.api.model.Namespace;
 import io.fabric8.kubernetes.api.model.Pod;
 import io.fabric8.kubernetes.api.model.extensions.Ingress;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import io.fabric8.kubernetes.client.KubernetesClient;
 import org.apache.commons.lang.StringUtils;
 import org.apache.karaf.shell.api.action.Command;
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkPolicyStore.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkPolicyStore.java
index 69c522a..c917f90 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkPolicyStore.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkPolicyStore.java
@@ -22,13 +22,13 @@
 import io.fabric8.kubernetes.api.model.LabelSelectorRequirement;
 import io.fabric8.kubernetes.api.model.ManagedFieldsEntry;
 import io.fabric8.kubernetes.api.model.ObjectMeta;
-import io.fabric8.kubernetes.api.model.networking.IPBlock;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyEgressRule;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyIngressRule;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyPeer;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyPort;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicySpec;
+import io.fabric8.kubernetes.api.model.networking.v1.IPBlock;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyEgressRule;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyIngressRule;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyPeer;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyPort;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicySpec;
 import org.onlab.util.KryoNamespace;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sEndpointsWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sEndpointsWatcher.java
index 62c15e6..88d8c51 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sEndpointsWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sEndpointsWatcher.java
@@ -17,8 +17,8 @@
 
 import io.fabric8.kubernetes.api.model.Endpoints;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -158,7 +158,11 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose() {
+        }
+
+        @Override
+        public void onClose(WatcherException e) {
             log.warn("Endpoints watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sIngressWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sIngressWatcher.java
index 2373713..236dd1c 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sIngressWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sIngressWatcher.java
@@ -17,8 +17,8 @@
 
 import io.fabric8.kubernetes.api.model.extensions.Ingress;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -158,7 +158,7 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose(WatcherException e) {
             log.warn("Ingress watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNamespaceWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNamespaceWatcher.java
index 1ce7f9f..fbd51a8 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNamespaceWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNamespaceWatcher.java
@@ -17,8 +17,8 @@
 
 import io.fabric8.kubernetes.api.model.Namespace;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -159,7 +159,7 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose(WatcherException e) {
             log.warn("Namespace watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyHandler.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyHandler.java
index 7125d06..ba54000 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyHandler.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyHandler.java
@@ -22,11 +22,12 @@
 import io.fabric8.kubernetes.api.model.Namespace;
 import io.fabric8.kubernetes.api.model.Pod;
 import io.fabric8.kubernetes.api.model.Service;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyEgressRule;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyIngressRule;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyPeer;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicyPort;
+
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyEgressRule;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyIngressRule;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyPeer;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicyPort;
 import org.onlab.packet.IPv4;
 import org.onlab.packet.IpAddress;
 import org.onlab.packet.IpPrefix;
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManager.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManager.java
index 8f43afd..c7b4e70 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManager.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManager.java
@@ -17,7 +17,7 @@
 
 import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableSet;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.event.ListenerRegistry;
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyWatcher.java
index 3ded560..12fd6a1 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyWatcher.java
@@ -15,10 +15,10 @@
  */
 package org.onosproject.k8snetworking.impl;
 
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -160,7 +160,7 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose(WatcherException e) {
             log.warn("Network policy watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodPortMapper.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodPortMapper.java
index dfc77cf..998071d 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodPortMapper.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodPortMapper.java
@@ -17,6 +17,7 @@
 
 import com.google.common.collect.Maps;
 import io.fabric8.kubernetes.api.model.Pod;
+import io.fabric8.kubernetes.api.model.PodBuilder;
 import io.fabric8.kubernetes.client.KubernetesClient;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
@@ -179,10 +180,11 @@
 
                     client.pods().inNamespace(pod.getMetadata().getNamespace())
                             .withName(pod.getMetadata().getName())
-                            .edit()
-                            .editMetadata()
-                            .addToAnnotations(annotations)
-                            .endMetadata().done();
+                            .edit(r -> new PodBuilder(r)
+                                    .editMetadata()
+                                    .addToAnnotations(annotations)
+                                    .endMetadata().build()
+                            );
                 });
         }
     }
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodWatcher.java
index 1fd1808..cfa9855 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sPodWatcher.java
@@ -17,8 +17,8 @@
 
 import io.fabric8.kubernetes.api.model.Pod;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -156,7 +156,7 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose(WatcherException e) {
             log.warn("Pod watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sServiceWatcher.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sServiceWatcher.java
index 489eee3..b4b5da4 100644
--- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sServiceWatcher.java
+++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/K8sServiceWatcher.java
@@ -17,8 +17,8 @@
 
 import io.fabric8.kubernetes.api.model.Service;
 import io.fabric8.kubernetes.client.KubernetesClient;
-import io.fabric8.kubernetes.client.KubernetesClientException;
 import io.fabric8.kubernetes.client.Watcher;
+import io.fabric8.kubernetes.client.WatcherException;
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.LeadershipService;
 import org.onosproject.cluster.NodeId;
@@ -159,7 +159,7 @@
         }
 
         @Override
-        public void onClose(KubernetesClientException e) {
+        public void onClose(WatcherException e) {
             log.warn("Service watcher OnClose", e);
         }
 
diff --git a/apps/k8s-networking/app/src/test/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManagerTest.java b/apps/k8s-networking/app/src/test/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManagerTest.java
index 9642cd2..b3854ba 100644
--- a/apps/k8s-networking/app/src/test/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManagerTest.java
+++ b/apps/k8s-networking/app/src/test/java/org/onosproject/k8snetworking/impl/K8sNetworkPolicyManagerTest.java
@@ -18,7 +18,7 @@
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.MoreExecutors;
 import io.fabric8.kubernetes.api.model.ObjectMeta;
-import io.fabric8.kubernetes.api.model.networking.NetworkPolicy;
+import io.fabric8.kubernetes.api.model.networking.v1.NetworkPolicy;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
diff --git a/apps/k8s-node/BUILD b/apps/k8s-node/BUILD
index 96724fb..3eb5494 100644
--- a/apps/k8s-node/BUILD
+++ b/apps/k8s-node/BUILD
@@ -4,6 +4,26 @@
     "@commons_net//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
diff --git a/apps/k8s-node/app/BUILD b/apps/k8s-node/app/BUILD
index b886139..aba9b4b 100644
--- a/apps/k8s-node/app/BUILD
+++ b/apps/k8s-node/app/BUILD
@@ -5,6 +5,26 @@
     "//apps/k8s-node/api:onos-apps-k8s-node-api",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
diff --git a/apps/kubevirt-networking/BUILD b/apps/kubevirt-networking/BUILD
index 4dfceee..bdf8b8c 100644
--- a/apps/kubevirt-networking/BUILD
+++ b/apps/kubevirt-networking/BUILD
@@ -7,10 +7,31 @@
     "@json//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
     "@jackson_dataformat_yaml//jar",
+    "@jackson_datatype_jsr310//jar",
     "@snakeyaml//jar",
     "@zjsonpatch//jar",
     "@validation_api//jar",
diff --git a/apps/kubevirt-networking/api/BUILD b/apps/kubevirt-networking/api/BUILD
index 3f1c431..b3aa0bd 100644
--- a/apps/kubevirt-networking/api/BUILD
+++ b/apps/kubevirt-networking/api/BUILD
@@ -1,11 +1,32 @@
 COMPILE_DEPS = CORE_DEPS + [
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@ipaddress//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
     "@jackson_dataformat_yaml//jar",
+    "@jackson_datatype_jsr310//jar",
     "@snakeyaml//jar",
     "@commons_net//jar",
 ]
diff --git a/apps/kubevirt-networking/app/BUILD b/apps/kubevirt-networking/app/BUILD
index 75b5b42..6bdd6ec 100644
--- a/apps/kubevirt-networking/app/BUILD
+++ b/apps/kubevirt-networking/app/BUILD
@@ -9,10 +9,31 @@
     "@json//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
     "@jackson_dataformat_yaml//jar",
+    "@jackson_datatype_jsr310//jar",
     "@snakeyaml//jar",
     "@zjsonpatch//jar",
     "@validation_api//jar",
diff --git a/apps/kubevirt-node/BUILD b/apps/kubevirt-node/BUILD
index c0fb377..633bea2 100644
--- a/apps/kubevirt-node/BUILD
+++ b/apps/kubevirt-node/BUILD
@@ -4,10 +4,31 @@
     "@commons_net//jar",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
     "@jackson_dataformat_yaml//jar",
+    "@jackson_datatype_jsr310//jar",
     "@snakeyaml//jar",
 ]
 
diff --git a/apps/kubevirt-node/app/BUILD b/apps/kubevirt-node/app/BUILD
index 372831d..ffb35e5 100644
--- a/apps/kubevirt-node/app/BUILD
+++ b/apps/kubevirt-node/app/BUILD
@@ -5,10 +5,31 @@
     "//apps/kubevirt-node/api:onos-apps-kubevirt-node-api",
     "@k8s_client//jar",
     "@k8s_model//jar",
+    "@k8s_model_common//jar",
+    "@k8s_model_core//jar",
+    "@k8s_model_rbac//jar",
+    "@k8s_model_apps//jar",
+    "@k8s_model_admissionregistration//jar",
+    "@k8s_model_apiextensions//jar",
+    "@k8s_model_batch//jar",
+    "@k8s_model_certificates//jar",
+    "@k8s_model_coordination//jar",
+    "@k8s_model_discovery//jar",
+    "@k8s_model_metrics//jar",
+    "@k8s_model_scheduling//jar",
+    "@k8s_model_settings//jar",
+    "@k8s_model_storageclass//jar",
+    "@k8s_model_autoscaling//jar",
+    "@k8s_model_events//jar",
+    "@k8s_model_extensions//jar",
+    "@k8s_model_networking//jar",
+    "@k8s_model_node//jar",
+    "@k8s_model_policy//jar",
     "@okhttp//jar",
     "@okio//jar",
     "@logging_interceptor//jar",
     "@jackson_dataformat_yaml//jar",
+    "@jackson_datatype_jsr310//jar",
     "@snakeyaml//jar",
     "@commons_net//jar",
 ]