Skip to content

Only delete created subnet and VPC in postgres test progs#5658

Open
jeremyevans wants to merge 3 commits into
mainfrom
jeremy-pg-local-e2e
Open

Only delete created subnet and VPC in postgres test progs#5658
jeremyevans wants to merge 3 commits into
mainfrom
jeremy-pg-local-e2e

Conversation

@jeremyevans

Copy link
Copy Markdown
Contributor

Previously, this assumed any subnet or GCP VPC in the project was
related to the test, which isn't correct if a shared project is used, as
it is for local E2E tests. The prog keeps track of the created subnet,
so it knows which subnet was created, and can delete that subnet
specifically. For GCP VPC, it can know the specific VPC if a VPC is
created per subnet. Make that the default behavior, and change the code
to look for the specific VPC in that case.

Change the progs from calling nap_if_gcp_vpc before
nap_if_private_subnet, because when dedicated GCP VPCs are used, the
private subnet cannot be deleted until after the GCP VPC is deleted,
since the GCP VPC references the private subnet.

Make a couple of minor improvements while here.

This was missed in the initial conversion pass.
Depending on spec order, not requriing it can result in a spec error.
Previously, this assumed any subnet or GCP VPC in the project was
related to the test, which isn't correct if a shared project is used, as
it is for local E2E tests. The prog keeps track of the created subnet,
so it knows which subnet was created, and can delete that subnet
specifically. For GCP VPC, it can know the specific VPC if a VPC is
created per subnet. Make that the default behavior, and change the code
to look for the specific VPC in that case.

Change the progs from calling nap_if_gcp_vpc before
nap_if_private_subnet, because when dedicated GCP VPCs are used, the
private subnet cannot be deleted until after the GCP VPC is deleted,
since the GCP VPC references the private subnet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant