weizhouapache commented on code in PR #11468:
URL: https://github.com/apache/cloudstack/pull/11468#discussion_r2291171554
##########
server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java:
##########
@@ -1294,8 +1294,13 @@ public boolean assignCertToLoadBalancer(long lbRuleId,
Long certId) {
//check if the lb is already bound
LoadBalancerCertMapVO certMapRule =
_lbCertMapDao.findByLbRuleId(loadBalancer.getId());
- if (certMapRule != null)
- throw new InvalidParameterValueException("Another certificate is
already bound to the LB");
+ if (certMapRule != null) {
+ if (!forced) {
+ throw new InvalidParameterValueException("Another certificate
is already bound to the LB");
+ }
+ logger.debug("Another certificate is already bound to the LB,
removing it");
+ removeCertFromLoadBalancer(lbRuleId);
+ }
Review Comment:
added method `validateCertMapRule`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]