commit | f73b1ec4cb3821506a15f0d4719fdae04ebe3ffb | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Tue Dec 24 21:39:33 2019 +0900 |
committer | Jian Li <pyguni@gmail.com> | Wed Mar 04 08:46:29 2020 +0000 |
tree | 1544f08a1cfca8bb6f22cf6d8d0661dec7a58c75 | |
parent | 8108f22eaf77e18eccc1722476148d513927f3b7 [diff] |
Fix: do not propagate PORT_REMOVED event if the event has null value Change-Id: I0cfe520a8910e7aea6b182836deb6dc8469c8e7c
diff --git a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkStore.java b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkStore.java index 9117e31..301aa0e 100644 --- a/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkStore.java +++ b/apps/k8s-networking/app/src/main/java/org/onosproject/k8snetworking/impl/DistributedK8sNetworkStore.java
@@ -262,10 +262,17 @@ break; case REMOVE: log.debug("Kubernetes port removed"); - notifyDelegate(new K8sNetworkEvent( - K8S_PORT_REMOVED, - network(event.oldValue().value().networkId()), - event.oldValue().value())); + + // if the event object has invalid port value, we do not + // propagate K8S_PORT_REMOVED event. + if (event.oldValue() != null && + event.oldValue().value() != null) { + notifyDelegate(new K8sNetworkEvent( + K8S_PORT_REMOVED, + network(event.oldValue().value().networkId()), + event.oldValue().value())); + } + break; default: // do nothing