You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7096bdb
Browse filesBrowse the repository at this point in the historyBrowse files
Make vpc.max.networks dynamic and return a useful error at the limit (#14373)
* Make vpc.max.networks dynamic and return a clear error at the limit
* Apply suggestions from code review
Drop account name from the max VPCs error
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
---------
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
@@ -2587,9 +2583,12 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
2587
2583
2588
2584
try {
2589
2585
// check number of active networks in vpc
2590
-
if (_ntwkDao.countVpcNetworks(vpc.getId()) >= _maxNetworks) {
2591
-
logger.warn(String.format("Failed to create a new VPC Guest Network because the number of networks per VPC has reached its maximum capacity of [%s]. Increase it by modifying global config [%s].", _maxNetworks, Config.VpcMaxNetworks));
2592
-
thrownewCloudRuntimeException(String.format("Number of networks per VPC cannot surpass [%s].", _maxNetworks));
2586
+
finalintmaxNetworks = VpcMaxNetworks.value();
2587
+
if (_ntwkDao.countVpcNetworks(vpc.getId()) >= maxNetworks) {
2588
+
logger.warn("Failed to create a new network in VPC [{}] because it has reached the maximum of [{}] networks. "
2589
+
+ "Increase it by modifying the global setting [{}].", vpc, maxNetworks, VpcMaxNetworks.key());
2590
+
thrownewInvalidParameterValueException(String.format("VPC %s has reached the maximum of %d networks. "
2591
+
+ "Delete an unused network or contact your platform administrator to raise the limit.", vpc.getName(), maxNetworks));
2593
2592
}
2594
2593
2595
2594
// 1) CIDR is required
@@ -3728,7 +3727,8 @@ public String getConfigComponentName() {
0 commit comments