Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLT-2830 : Fix the stale policy in case of action updatae #3863

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static List<RangerPolicy> applyDeltas(List<RangerPolicy> policies, List<R
while (iter.hasNext()) {
RangerPolicy policy = iter.next();
if (
(changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_UPDATE && policyId.equals(policy.getGuid())) ||
(changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_UPDATE && policyId.equals(policy.getAtlasGuid())) ||
(changeType == RangerPolicyDelta.CHANGE_TYPE_POLICY_DELETE && policyId.equals(policy.getAtlasGuid()))
){
deletedPolicies.add(policy);
Expand All @@ -108,7 +108,7 @@ public static List<RangerPolicy> applyDeltas(List<RangerPolicy> policies, List<R
break;
}
case RangerPolicyDelta.CHANGE_TYPE_POLICY_UPDATE: {
if (CollectionUtils.isEmpty(deletedPolicies) || deletedPolicies.size() > 1) {
if (CollectionUtils.isEmpty(deletedPolicies)) {
LOG.warn("Unexpected: found no policy or multiple policies for CHANGE_TYPE_POLICY_UPDATE: " + Arrays.toString(deletedPolicies.toArray()));
}
break;
Expand Down
Loading