Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann0617 committed Dec 28, 2024
1 parent 0a8c1eb commit a6e5ed9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,13 @@ public void releaseSecurityRule(Vcn vcn, Integer type) {
outList = Collections.singletonList(out6);
break;
default:
inList = Arrays.asList(in4, in6);
outList = Arrays.asList(out4, out6);
if (vcn.getIpv6PrivateCidrBlocks().isEmpty()) {
inList = Collections.singletonList(in4);
outList = Collections.singletonList(out4);
} else {
inList = Arrays.asList(in4, in6);
outList = Arrays.asList(out4, out6);
}
}

GetSecurityListRequest getSecurityListRequest = GetSecurityListRequest.builder().securityListId(vcn.getDefaultSecurityListId()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ public InstanceCfgDTO getInstanceCfgInfo(SysUserDTO sysUserDTO, String instanceI
public void releaseSecurityRule(SysUserDTO sysUserDTO) {
try (OracleInstanceFetcher fetcher = new OracleInstanceFetcher(sysUserDTO)) {
Vcn vcn = fetcher.listVcn().get(0);
if (null == vcn) {
throw new OciException(-1, "当前用户未创建VCN,无法放行安全列表");
}
fetcher.releaseSecurityRule(vcn, 0);
log.info("用户:[{}] ,区域:[{}] ,放行安全列表所有端口及协议成功",
sysUserDTO.getUsername(), sysUserDTO.getOciCfg().getRegion());
Expand Down

0 comments on commit a6e5ed9

Please sign in to comment.