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

provider/aws: Fix reading auto scaling group termination policies #5101

Merged
merged 3 commits into from
Feb 23, 2016
Merged

provider/aws: Fix reading auto scaling group termination policies #5101

merged 3 commits into from
Feb 23, 2016

Conversation

tpounds
Copy link
Contributor

@tpounds tpounds commented Feb 11, 2016

Similar fix to #5044 and #5045 that fixes reading an auto scaling groups' termination policies. I also added an acceptance test to make sure the default termination policy is applied as expected.

@tpounds
Copy link
Contributor Author

tpounds commented Feb 11, 2016

FYI. There is a subtle problem with this change. I'm in the process of fixing it. I will provide an update once the issue is fixed.

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Feb 12, 2016
@catsby
Copy link
Contributor

catsby commented Feb 12, 2016

Thanks for letting us know, just ping here when it's ready 😄

@tpounds
Copy link
Contributor Author

tpounds commented Feb 21, 2016

@catsby Should be good to go now. Let me know if you see anything that can be improved.

@phinze phinze removed the waiting-response An issue/pull request is waiting for a response from the community label Feb 23, 2016
// with the default AWS create API behavior.
_, ok := d.GetOk("termination_policies")
if !ok && len(g.TerminationPolicies) == 1 && *g.TerminationPolicies[0] == "Default" {
d.Set("termination_policies", []string{})
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be []interface{}, same as the return type of flattenStringList.

Copy link
Contributor

Choose a reason for hiding this comment

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

As a rule of thumb we check the error return on non-primitive d.Set() calls, which I believe would expose the above issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. AFAICT, this doesn't seem like this is done much in practice. I'll fix up to use []interface{} though.

@phinze
Copy link
Contributor

phinze commented Feb 23, 2016

Thanks for this, @tpounds! See inline for a few comments.

@tpounds
Copy link
Contributor Author

tpounds commented Feb 23, 2016

@catsby Updated to use []interface{}. LMK if I should address anything else.

@phinze
Copy link
Contributor

phinze commented Feb 23, 2016

@tpounds Sorry didn't make it clear in the comment - []interface{}{} would be the literal declaration of an empty []interface{}.

@phinze
Copy link
Contributor

phinze commented Feb 23, 2016

@tamsky Once that is fixed - this looks good to go! Exercised locally and it seems to be working 👍

@phinze
Copy link
Contributor

phinze commented Feb 23, 2016

Whoops! Bad auto-complete there, sorry! Meant @tpounds 😝

@tpounds
Copy link
Contributor Author

tpounds commented Feb 23, 2016

Gah! 100% my fault. Should have built locally before pushing. Should be good now. 😉

phinze added a commit that referenced this pull request Feb 23, 2016
…licies

provider/aws: Fix reading auto scaling group termination policies
@phinze phinze merged commit b5e6a4f into hashicorp:master Feb 23, 2016
@ghost
Copy link

ghost commented Apr 28, 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 Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants