You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2023/10/06 16:01:12 UTC

[ranger] branch master updated: RANGER-4451: when the last service is removed from zone, the zone should not be deleted

This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new db665595f RANGER-4451: when the last service is removed from zone, the zone should not be deleted
db665595f is described below

commit db665595f90949b79ed92e6d2a68e7e443e8958b
Author: Dineshkumar Yadav <di...@outlook.com>
AuthorDate: Fri Oct 6 17:57:25 2023 +0530

    RANGER-4451: when the last service is removed from zone, the zone should not be deleted
    
    Signed-off-by: Madhan Neethiraj <ma...@apache.org>
---
 .../src/main/java/org/apache/ranger/biz/ServiceDBStore.java          | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
index cfb7a6f23..cd92d92b4 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java
@@ -6081,8 +6081,6 @@ public class ServiceDBStore extends AbstractServiceStore {
 
 	/**
 	 * Removes given service from security zones.
-	 * And if given service is the only service
-	 * associated with security zone, remove zone.
 	 * @param service
 	 * @throws Exception
 	 */
@@ -6099,9 +6097,6 @@ public class ServiceDBStore extends AbstractServiceStore {
 					securityZone.setServices(zoneServices);
 					securityZoneStore.updateSecurityZoneById(securityZone);
 
-					if (zoneServices.isEmpty()) {
-						securityZoneStore.deleteSecurityZoneByName(zoneName);
-					}
 				}
 			}
 		}