Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

platform/api/aws/networking: detect broken networking #930

Closed
wants to merge 1 commit into from

Conversation

arithx
Copy link
Contributor

@arithx arithx commented Oct 9, 2018

Add detection for missing networking pieces when selecting a security
group (tearing down and recreating them if resources are missing).

Fixes #914

Add detection for missing networking pieces when selecting a security
group (tearing down and recreating them if resources are missing).

Fixes coreos#914
Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

The code looks okay. I'm not sure whether it's a good idea, though.

  • Multiple simultaneous machine launches, or multiple kola runs, could fight with each other deleting and creating network resources.
  • The problem this is solving seems relatively obscure for the amount of code.

@@ -340,3 +348,115 @@ func (a *API) getVPCID(sgId string) (string, error) {
}
return "", fmt.Errorf("no vpc found for security group %v", sgId)
}

func (a *API) validateNetworkResources(sg *ec2.SecurityGroup) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function name doesn't make completely clear what the bool return value is, or that it can delete resources as a side effect.

GroupId: sgId,
})
if err != nil {
return fmt.Errorf("deleting security group: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the resource IDs included in err? If not, they should be added to these error messages.

@arithx
Copy link
Contributor Author

arithx commented Nov 8, 2018

After OOB discussions this PR is going to get split up once Flight (#940) merges into the creation/deletion of networking resources in AWS as ore commands & a networking validation inside of the AWS Flight object creation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants