Skip to content
Closed
Show file tree
Hide file tree
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 @@ -629,6 +629,8 @@ private String getLbActiveMonitorPath(String lbServerPoolName, String port, Stri
LBUdpMonitorProfile lbUdpMonitorProfile = new LBUdpMonitorProfile.Builder(UDP_MONITOR_PROFILE)
.setDisplayName(lbMonitorProfileId)
.setMonitorPort(Long.parseLong(port))
.setSend("")
.setReceive("")
.build();
lbActiveMonitor.patch(lbMonitorProfileId, lbUdpMonitorProfile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ public boolean applyPFRules(Network network, List<PortForwardingRule> rules) thr
for (PortForwardingRule rule : rules) {
IPAddressVO publicIp = ApiDBUtils.findIpAddressById(rule.getSourceIpAddressId());
UserVm vm = ApiDBUtils.findUserVmById(rule.getVirtualMachineId());
if ((vm == null && (rule.getState() != FirewallRule.State.Revoke)) ||
(vm != null && networkModel.getNicInNetwork(vm.getId(), network.getId()) == null)) {
if (vm == null && rule.getState() != FirewallRule.State.Revoke) {
continue;
}
NsxOpObject nsxObject = getNsxOpObject(network);
Expand Down Expand Up @@ -664,7 +663,7 @@ public boolean applyLBRules(Network network, List<LoadBalancingRule> rules) thro
.setPublicPort(String.valueOf(loadBalancingRule.getSourcePortStart()))
.setPrivatePort(String.valueOf(loadBalancingRule.getDefaultPortStart()))
.setRuleId(loadBalancingRule.getId())
.setProtocol(loadBalancingRule.getProtocol().toUpperCase(Locale.ROOT))
.setProtocol(loadBalancingRule.getLbProtocol().toUpperCase(Locale.ROOT))
.setAlgorithm(loadBalancingRule.getAlgorithm())
.build();
if (loadBalancingRule.getState() == FirewallRule.State.Add) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public void testApplyLBRules_add() throws ResourceUnavailableException {
LoadBalancerVO lb = new LoadBalancerVO(null, null, null, 0L, 8080, 8081, null, 0L, 0L, 1L, null, null);
lb.setState(FirewallRule.State.Add);
LoadBalancingRule.LbDestination destination = new LoadBalancingRule.LbDestination(6443, 6443, "172.30.110.11", false);
LoadBalancingRule rule = new LoadBalancingRule(lb, List.of(destination), null, null, new Ip("10.1.13.10"));
LoadBalancingRule rule = new LoadBalancingRule(lb, List.of(destination), null, null, new Ip("10.1.13.10"), null, "TCP");

VpcVO vpc = Mockito.mock(VpcVO.class);

Expand All @@ -415,7 +415,7 @@ public void testApplyLBRules_delete() throws ResourceUnavailableException {
LoadBalancerVO lb = new LoadBalancerVO(null, null, null, 0L, 8080, 8081, null, 0L, 0L, 1L, null, null);
lb.setState(FirewallRule.State.Revoke);
LoadBalancingRule.LbDestination destination = new LoadBalancingRule.LbDestination(6443, 6443, "172.30.110.11", false);
LoadBalancingRule rule = new LoadBalancingRule(lb, List.of(destination), null, null, new Ip("10.1.13.10"));
LoadBalancingRule rule = new LoadBalancingRule(lb, List.of(destination), null, null, new Ip("10.1.13.10"), null, "TCP");

VpcVO vpc = Mockito.mock(VpcVO.class);

Expand Down