Skip to content

Commit 523620f

Browse files
committed
Prevent addition of duplicate PF rules on scale up and no rules left behind on scale down (#32)
1 parent 19f79b1 commit 523620f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,12 @@ protected void removePortForwardingRules(final IpAddress publicIp, final Network
551551
for (PortForwardingRuleVO pfRule : pfRules) {
552552
if (startPort <= pfRule.getSourcePortStart() && pfRule.getSourcePortStart() <= endPort) {
553553
portForwardingRulesDao.remove(pfRule.getId());
554+
LOGGER.trace("Marking PF rule " + pfRule + " with Revoke state");
555+
pfRule.setState(FirewallRule.State.Revoke);
556+
554557
}
555558
}
556-
rulesService.applyPortForwardingRules(publicIp.getId(), account);
559+
firewallManager.applyRules(pfRules, false, true);
557560
}
558561

559562
protected void removeLoadBalancingRule(final IpAddress publicIp, final Network network,

0 commit comments

Comments
 (0)