-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/opsworks_layers: Removed deprecated normalizeJson function #3081
Conversation
49093d6
to
5f70fc8
Compare
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.
LGTM, thanks for the cleanup.
Just two nitpicks, nothing major.
aws/opsworks_layers.go
Outdated
} else { | ||
policy, err := structure.NormalizeJsonString(*v) | ||
if err != nil { | ||
return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err) |
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.
Nitpick: As this error is going to be raised straight to the user I don't see the point in using errwrap here.
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.
Updated, thanks for the explanation btw!
aws/opsworks_layers.go
Outdated
if v == nil { | ||
d.Set("custom_json", "") | ||
} else { | ||
policy, err := structure.NormalizeJsonString(*v) |
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.
Nitpick: The short variable name v
was ok-ish when it was in the previously short context, but I think we should now just reference layer.CustomJson
in all 3 places for clarity.
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.
Sure thing
5f70fc8
to
1dbd8c5
Compare
1dbd8c5
to
d576f3c
Compare
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Description
This is the continuation of #2935.
It removes the deprecated
normalizeJson
function usage inopsworks_layers.go
, removing the function definition inresource_aws_s3_bucket.go
.This also fixes the following failing test:
Tests