Skip to content

Conversation

@josvazg
Copy link
Collaborator

@josvazg josvazg commented Nov 29, 2023

Seems that ListPeeringConnections would render only AWS related peering by default.

Apart from that, GCP VPC removals could not be done before removing their subnets.

Fixing both here should probably fix the issues for GCP. For Azure we have not detected stuck entries so far.

All Submissions:

  • Have you signed our CLA?

@josvazg josvazg requested a review from helderjs November 29, 2023 07:11
@josvazg josvazg marked this pull request as draft November 29, 2023 07:11
Signed-off-by: Jose Vazquez <jose.vazquez@mongodb.com>
@josvazg josvazg force-pushed the CLOUDP-212108/fix-np-cleanups branch from 90405ba to ad0d922 Compare November 29, 2023 10:04
@josvazg josvazg marked this pull request as ready for review November 29, 2023 10:07
@josvazg josvazg merged commit 22fbe55 into main Nov 29, 2023
@josvazg josvazg deleted the CLOUDP-212108/fix-np-cleanups branch November 29, 2023 10:21
if err != nil {
fmt.Println(text.FgRed.Sprintf("\tFailed to list networking peering for project %s: %s", projectID, err))
var (
SupportedProviders = []string{"AWS", "AZURE", "GCP"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In atlas.go there are already constants with the supported cloud providers, please reuse them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

SupportedProviders = []string{"AWS", "AZURE", "GCP"}
)

func (c *Cleaner) listNetworkPeering(ctx context.Context, projectID string) []admin.BaseNetworkPeeringConnectionSettings {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See GetProjectDependencies() in projects.go and consider move the provider logic to there.
Reason is that Gov only support AWS and make a request for other provider results in an error

}

func (gcp *GCP) DeleteVpc(ctx context.Context, vpcName string) error {
vpcGetRequest := &computepb.GetNetworkRequest{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does GCP require subnets to be remove VPCs with subnets? seems strange

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it failed on my test until I added this code.

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.

4 participants