Fix for the issue: CM routes pointing to spine instead of pg pod after updating netcfg.
DualHomed subnets add and remove issues addressed.
Change-Id: I41c333923e2f2170834d1c83485a418b893f44da
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index 8a2e353..b4aaec8 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -1303,6 +1303,26 @@
return checkJobs(futures);
}
+ /**
+ * Revoke rules of given subnets in the given switches.
+ *
+ * @param targetSwitches switched from which subnets to be removed
+ * @param subnets subnet bring removed
+ * @return true if succeed
+ */
+ protected boolean revokeSubnet(Set<DeviceId> targetSwitches, Set<IpPrefix> subnets) {
+ List<Future<Boolean>> futures = Lists.newArrayList();
+ for (DeviceId targetSw : targetSwitches) {
+ if (shouldProgram(targetSw)) {
+ futures.add(routePopulators.submit(new RevokeSubnet(targetSw, subnets)));
+ } else {
+ futures.add(CompletableFuture.completedFuture(true));
+ }
+ }
+ // check the execution of each job
+ return checkJobs(futures);
+ }
+
private final class RevokeSubnet implements PickyCallable<Boolean> {
private DeviceId targetSw;
private Set<IpPrefix> subnets;