Skip to content

Commit 2992394

Browse files
authored
feat(oracle): only allow public subnets to be selected from target VCN (canonical#318)
The OCI VCN creation wizard creates both a public and a private subnet and if the private subnet ends up being the first subnet, then this would cause all CTF tests using this VCN to hang up and fail because pycloudlib blindly chooses the first subnet. Now, private subnets will be skipped/ignored, and the first public subnet will be selected.
1 parent f9d7420 commit 2992394

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1!5.3.0
1+
1!5.4.0

pycloudlib/oci/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ def get_subnet_id(
7171
subnets = network_client.list_subnets(compartment_id, vcn_id=vcn_id).data
7272
subnet_id = None
7373
for subnet in subnets:
74+
if subnet.prohibit_internet_ingress: # skip subnet if it's private
75+
print("Ignoring private subnet: " + subnet.id)
76+
continue
77+
print("Using public subnet: " + subnet.id)
7478
if subnet.availability_domain == availability_domain:
7579
subnet_id = subnet.id
7680
break

0 commit comments

Comments
 (0)