-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] r/aws_route: Correctly handle update of route target #14050
Closed
Closed
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
232e4fa
r/aws_route: Tidy up 'testAccAWSRouteConfigBasic()'.
ewbankkit df47227
r/aws_route: Rename 'TestAccAWSRoute_ipv6Support' to 'TestAccAWSRoute…
ewbankkit 4e2bfc8
Remove 'TestAccAWSRoute_noopdiff'. Test steps implicitly test this fu…
ewbankkit 3130d83
r/aws_route: Tidy up 'TestAccAWSRoute_doesNotCrashWithVPCEndpoint'.
ewbankkit 38edb5e
r/aws_route: Tidy up 'TestAccAWSRoute_ipv6ToInternetGateway'.
ewbankkit 6f40ed1
r/aws_route: Tidy up 'TestAccAWSRoute_ipv6ToInstance'.
ewbankkit 600d0ae
r/aws_route: Tidy up 'TestAccAWSRoute_ipv6ToNetworkInterface'.
ewbankkit a33370f
r/aws_route: Tidy up 'TestAccAWSRoute_ipv6ToVpcPeeringConnection'.
ewbankkit d0b739b
r/aws_route: Tidy up 'TestAccAWSRoute_TransitGatewayID_DestinationCid…
ewbankkit 64b26ff
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_Instance'.
ewbankkit ae11dde
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_NetworkInterface'.
ewbankkit 390f354
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_VpcPeeringConnection'.
ewbankkit eb9b623
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_NatGateway'.
ewbankkit 5c4fb7e
r/aws_route: Comment out failing target update test.
ewbankkit efc37d7
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_VpnGateway'.
ewbankkit 8596c78
r/aws_route: Add 'TestAccAWSRoute_IPv6_To_VpnGateway'.
ewbankkit f375bd9
r/aws_route: Test computed attributes.
ewbankkit bf846c9
r/aws_route: Changes for #13766, #13771.
ewbankkit 778f0d7
r/aws_route: 'testAccCheckAWSRouteNumberOfRoutes' -> 'testAccCheckAWS…
ewbankkit 7d38d16
r/aws_route: Add 'TestAccAWSRoute_routeTableDisappears'.
ewbankkit d42fc88
r/aws_route: Rework 'TestAccAWSRoute_ConditionalCidrBlock'.
ewbankkit f11a665
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_NetworkInterface_Attached' …
ewbankkit f462ff3
r/aws_route: Add 'TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachm…
ewbankkit 9fb69bd
r/aws_route: Comment out failing 'TestAccAWSRoute_IPv4_To_NetworkInte…
ewbankkit a86e680
r/aws_route: Use 'available' as the name of the 'aws_availability_zon…
ewbankkit bc9a711
r/aws_route: Add 'TestAccAWSRoute_IPv4_Update_Target'. Currently fails.
ewbankkit 5495401
r/aws_route: Add 'TestAccAWSRoute_IPv6_Update_Target'. Currently fails.
ewbankkit 363c08d
r/aws_route: Better validation.
ewbankkit 2270c2b
r/aws_route: Correctly handle route target updates.
ewbankkit 6a2812b
r/aws_route: Uncommented 'TestAccAWSRoute_IPv4_To_NetworkInterface_Tw…
ewbankkit 7a3aca3
Acceptance test output:
ewbankkit ea1ec72
r/aws_route: Use 'available' as the name of the 'aws_availability_zon…
ewbankkit bfb4904
r/aws_route: Add 'TestAccAWSRoute_LocalRoute' to test ability to impo…
ewbankkit 722afda
r/aws_route: Add error constants to 'aws/internal/service/ec2'. Tweak…
ewbankkit b2b4fc2
r/aw3s_route: Move route finders to 'aws/internal/service/ec2/finder'…
ewbankkit 673c8ec
r/aws_route: Add 'createRoute' function.
ewbankkit a795a61
r/aws_route: Use Amazon NAT instance AMI for instance tests.
ewbankkit 22df25c
Acceptance test output:
ewbankkit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net | ||
|
||
import ( | ||
"net" | ||
) | ||
|
||
// CIDRBlocksEqual returns whether or not two CIDR blocks are equal: | ||
// - Both CIDR blocks parse to an IP address and network | ||
// - The string representation of the IP addresses are equal | ||
// - The string representation of the networks are equal | ||
// This function is especially useful for IPv6 CIDR blocks which have multiple valid representations. | ||
func CIDRBlocksEqual(cidr1, cidr2 string) bool { | ||
ip1, ipnet1, err := net.ParseCIDR(cidr1) | ||
if err != nil { | ||
return false | ||
} | ||
ip2, ipnet2, err := net.ParseCIDR(cidr2) | ||
if err != nil { | ||
return false | ||
} | ||
|
||
return ip2.String() == ip1.String() && ipnet2.String() == ipnet1.String() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func Test_CIDRBlocksEqual(t *testing.T) { | ||
for _, ts := range []struct { | ||
cidr1 string | ||
cidr2 string | ||
equal bool | ||
}{ | ||
{"10.2.2.0/24", "10.2.2.0/24", true}, | ||
{"10.2.2.0/1234", "10.2.2.0/24", false}, | ||
{"10.2.2.0/24", "10.2.2.0/1234", false}, | ||
{"2001::/15", "2001::/15", true}, | ||
{"::/0", "2001::/15", false}, | ||
{"::/0", "::0/0", true}, | ||
{"", "", false}, | ||
} { | ||
equal := CIDRBlocksEqual(ts.cidr1, ts.cidr2) | ||
if ts.equal != equal { | ||
t.Fatalf("CIDRBlocksEqual(%q, %q) should be: %t", ts.cidr1, ts.cidr2, ts.equal) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved here temporarily. Will need to clean up when support for managed prefix list IDs added.