Skip to content

Commit

Permalink
Update 8772: fix bean issue nsxService
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhouapache committed Mar 12, 2024
1 parent aab95be commit 6c07f33
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
3 changes: 3 additions & 0 deletions api/src/main/java/com/cloud/network/element/VpcProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.IpAddress;
import com.cloud.network.vpc.NetworkACLItem;
import com.cloud.network.vpc.PrivateGateway;
import com.cloud.network.vpc.StaticRouteProfile;
Expand Down Expand Up @@ -52,4 +53,6 @@ boolean implementVpc(Vpc vpc, DeployDestination dest, ReservationContext context
boolean applyStaticRoutes(Vpc vpc, List<StaticRouteProfile> routes) throws ResourceUnavailableException;

boolean applyACLItemsToPrivateGw(PrivateGateway gateway, List<? extends NetworkACLItem> rules) throws ResourceUnavailableException;

boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.IpAddress;
import com.cloud.network.Network;
import com.cloud.network.Network.Provider;
import com.cloud.network.element.NetworkACLServiceProvider;
Expand Down Expand Up @@ -196,4 +197,8 @@ public boolean applyACLItemsToPrivateGw(PrivateGateway privateGateway,
return true;
}

@Override
public boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.cloud.host.Host;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.network.IpAddress;
import com.cloud.network.Network;
import com.cloud.network.NetworkModel;
import com.cloud.network.Networks;
Expand Down Expand Up @@ -899,4 +900,9 @@ public List<Class<?>> getCommands() {
cmdList.add(ListInternalLoadBalancerElementsCmd.class);
return cmdList;
}

@Override
public boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address) {
return nsxService.updateVpcSourceNatIp(vpc, address);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,9 @@ public boolean stopVpn(final RemoteAccessVpn vpn) throws ResourceUnavailableExce
}
return result;
}

@Override
public boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import javax.naming.ConfigurationException;

import com.cloud.configuration.ConfigurationManager;
import com.cloud.network.nsx.NsxService;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.alert.AlertService;
import org.apache.cloudstack.annotation.AnnotationService;
Expand Down Expand Up @@ -265,9 +264,6 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
@Autowired
@Qualifier("networkHelper")
protected NetworkHelper networkHelper;
@Inject
private NsxService nsxService;

@Inject
private VpcPrivateGatewayTransactionCallable vpcTxCallable;

Expand Down Expand Up @@ -1433,7 +1429,8 @@ private boolean checkAndUpdateRouterSourceNatIp(Vpc vpc, String sourceNatIp) {
try {
_ipAddrMgr.updateSourceNatIpAddress(requestedIp, userIps);
if (isVpcForNsx(vpc)) {
nsxService.updateVpcSourceNatIp(vpc, requestedIp);
VpcProvider nsxElement = (VpcProvider) _ntwkModel.getElementImplementingProvider(Provider.Nsx.getName());
nsxElement.updateVpcSourceNatIp(vpc, requestedIp);
// The NSX source NAT IP change does not require to update the VPC VR
return false;
}
Expand Down

0 comments on commit 6c07f33

Please sign in to comment.