Skip to content
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

providers/aws: fix a few more bugs in launch configs #1444

Merged
merged 1 commit into from
Apr 9, 2015

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Apr 9, 2015

These bugs were found by additional check added in #1443

  • Reversed nil err check meant that block devices were broken :(
  • Fixing the err check revealed a few missed pointer derefs
  • Unlike instances, ephemeral block devices do come back in
    BlockDeviceMappings from DescribeLaunchConfigurations calls, so
    we need to recognize them and filter them properly. Even though
    they're not set as computed, I'm doing a d.Set since it doesn't
    hurt and it gives us the benefit of basic drift detection.

These bugs were found by additional check added in #1443

 * Reversed nil err check meant that block devices were broken :(
 * Fixing the err check revealed a few missed pointer derefs
 * Unlike instances, ephemeral block devices do come back in
   `BlockDeviceMappings` from `DescribeLaunchConfigurations` calls, so
   we need to recognize them and filter them properly. Even though
   they're not set as computed, I'm doing a `d.Set` since it doesn't
   hurt and it gives us the benefit of basic drift detection.
blockDevices["root"] = nil
if len(lc.BlockDeviceMappings) == 0 {
return nil, nil
}
rootDeviceName, err := fetchRootDeviceName(d.Get("image_id").(string), ec2conn)
if err == nil {
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🐼

@mitchellh
Copy link
Contributor

LGTM

phinze added a commit that referenced this pull request Apr 9, 2015
providers/aws: fix a few more bugs in launch configs
@phinze phinze merged commit 4363ac4 into master Apr 9, 2015
@phinze phinze deleted the b-launch-config-bugs branch April 9, 2015 15:24
@ghost
Copy link

ghost commented May 3, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 3, 2020
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