Skip to content

Commit

Permalink
subnet bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann0617 committed Feb 8, 2025
1 parent 0a2227d commit 3eff771
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,20 @@ synchronized public InstanceDetailDTO createInstanceData() {
subnet = createSubnet(virtualNetworkClient, compartmentId, availableDomain,
getCidr(virtualNetworkClient, compartmentId), vcn);
} else {
for (Subnet subnetExist : subnets) {
if (null == subnetExist.getAvailabilityDomain()) {
subnet = subnetExist;
break;
if (!listInstances().isEmpty()) {
subnet = subnets.get(0);
} else {
for (Subnet subnetExist : subnets) {
if (null == subnetExist.getAvailabilityDomain()) {
subnet = subnetExist;
break;
}
}
if (null == subnet) {
subnets.forEach(this::deleteSubnet);
subnet = createSubnet(virtualNetworkClient, compartmentId, availableDomain,
getCidr(virtualNetworkClient, compartmentId), vcn);
}
}
if (null == subnet) {
subnets.forEach(this::deleteSubnet);
subnet = createSubnet(virtualNetworkClient, compartmentId, availableDomain,
getCidr(virtualNetworkClient, compartmentId), vcn);
}
}
log.info("【开机任务】用户:[{}] ,区域:[{}] ,系统架构:[{}] ,检测到VCN:{} 存在,默认使用该VCN创建实例......",
Expand Down

0 comments on commit 3eff771

Please sign in to comment.