-
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
r/aws_redshift_snapshot_copy_grant: Remove extraneous Exists function #13052
r/aws_redshift_snapshot_copy_grant: Remove extraneous Exists function #13052
Conversation
#12864 has been merged so that functionality does not need to be reviewed again. 👍 |
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.
Just one minor pedantic question
Message: fmt.Sprintf("[DEBUG] Grant %s not found", grantName), | ||
LastRequest: input, | ||
} | ||
return out.SnapshotCopyGrants[0], nil |
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.
if err == nil is it guaranteed this slice has at least 1 item?
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.
In all my testing that was the case, err != nil
=> out != nil && len(out.SnapshotCopyGrants)
, but you are correct in that the previous code would have handled opposite by returning nil
for the grant. It's minor to add that back (plus change some of the callers to check for a nil
grant).
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.
Okay if you don't mind, once that change is made this will get merged! Thank you for helping with all the tech debt.
7ce8a84
to
b3bb017
Compare
@appilon Made the suggested changes and added the additional check to Acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRedshiftSnapshotCopyGrant_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSRedshiftSnapshotCopyGrant_ -timeout 120m
=== RUN TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== RUN TestAccAWSRedshiftSnapshotCopyGrant_Update
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_Update
=== RUN TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== PAUSE TestAccAWSRedshiftSnapshotCopyGrant_disappears
=== CONT TestAccAWSRedshiftSnapshotCopyGrant_Update
=== CONT TestAccAWSRedshiftSnapshotCopyGrant_Basic
=== CONT TestAccAWSRedshiftSnapshotCopyGrant_disappears
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_disappears (18.44s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Basic (23.83s)
--- PASS: TestAccAWSRedshiftSnapshotCopyGrant_Update (53.29s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 53.354s |
This has been released in version 2.60.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
…hashicorp#13052) * r/aws_redshift_snapshot_copy_grant: Remove extraneous Exists function. * Enable providerlint R003 as the last 'Exists' method has been removed. * Fix rebase duplication.
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! |
Community Note
Closes #9953.
Includes
testAccCheckResourceDisappears()
from #12864.Release note for CHANGELOG:
Output from acceptance testing: