-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: fix panic when route has no cidr_block #2215
Conversation
@@ -361,7 +361,10 @@ func resourceAwsRouteTableDelete(d *schema.ResourceData, meta interface{}) error | |||
func resourceAwsRouteTableHash(v interface{}) int { | |||
var buf bytes.Buffer | |||
m := v.(map[string]interface{}) | |||
buf.WriteString(fmt.Sprintf("%s-", m["cidr_block"].(string))) | |||
|
|||
if v, ok := m["cidr_block"]; ok { |
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.
doest this need to check for v.(string) != ""
as well ?
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.
oh whoops - didn't change next line to use v
- this would technically work but it's silly.
empty string is fine - you'll just generate a hash from the string w/ two dashes in it
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.
ah, at least gets around nil pointer 👍
🚀 |
ccfe468
to
cd434c3
Compare
LGTM! 👍 |
While cidr_block is required for static route creation, there are apparently cases (involving some combination of VPNs, Customer Gateways, and automatic route propogation) where the cidr_block can come back nil. This means we cannot assume it's there in the set hash calculation.
cd434c3
to
1caef30
Compare
provider/aws: fix panic when route has no cidr_block
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
While cidr_block is required for static route creation, there are
apparently cases (involving some combination of VPNs, Customer Gateways,
and automatic route propogation) where the cidr_block can come back nil.
This means we cannot assume it's there in the set hash calculation.