Update Subnet purpose for Netris Public Traffic (#17)

* Update Subnet purpose for Netris Public Traffic

* search for existing subnet of common purpose type
This commit is contained in:
Pearl Dsilva 2024-11-12 12:58:57 -05:00 committed by GitHub
parent c8eb0f3779
commit b497c65ff0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -444,10 +444,10 @@ public class NetrisApiClientImpl implements NetrisApiClient {
}
ipamAllocationId = new BigDecimal(ipamAllocation.getId());
}
IpTreeSubnet exactSubnet = getIpamSubnetByAllocationAndPrefixAndPurposeAndVpc(ipamAllocationId, exactCidr, IpTreeSubnet.PurposeEnum.NAT, systemVpc);
IpTreeSubnet exactSubnet = getIpamSubnetByAllocationAndPrefixAndPurposeAndVpc(ipamAllocationId, exactCidr, IpTreeSubnet.PurposeEnum.COMMON, systemVpc);
if (exactSubnet == null) {
String ipamSubnetName = NetrisResourceObjectUtils.retrieveNetrisResourceObjectName(cmd, NetrisResourceObjectUtils.NetrisObjectType.IPAM_SUBNET, exactCidr);
createIpamSubnetInternal(ipamSubnetName, exactCidr, SubnetBody.PurposeEnum.NAT, systemVpc);
createIpamSubnetInternal(ipamSubnetName, exactCidr, SubnetBody.PurposeEnum.COMMON, systemVpc);
}
} catch (ApiException e) {
String msg = String.format("Error setting up the Netris Public Range %s on super CIDR %s", exactCidr, superCidr);