-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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/waf_rule: catch referenced item exception when removing WAF rule; additional linting #17876
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you explain how this error is being retried? The
RetryWithToken
helper currently only handles thewaf.ErrCodeStaleDataException
error and this logic is swallowingwaf.ErrCodeReferencedItemException
. I'm guessing this might be passingTestAccAWSWafWebAcl_Rules
because that test usesCheckDestroy: testAccCheckAWSWafWebAclDestroy
and does not verify rule deletion.This logic would need another layer of
resource.Retry()
to retry successfully onwaf.ErrCodeReferencedItemException
and it might be worth creating a coveringTestAccAWSWafRule_
test for this behavior so it can useCheckDestroy: testAccCheckAWSWafRuleDestroy,
. 👍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.
ahh cannot be explained ..totally in the wrong place there! but I forgot i've wrestled with the
TestAccAWSWafWebACL_Rules
test quite some time ago and from what i've tried it's a case where if the test config steps were applied outside of the test env (i've most recently used the latest version of the provider w/terraform 0.14), the resource modifications occur without any error. And with the suggestion you've provided, I'm still seeing the same error :/ should i close this PR and revisit?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.
Personally, I'd love to get the rest of these PR changes in just so those refactorings are out of the way for the future. Up to you if you'd like to revert this small little bit so we can get those in or if you would prefer working on this section some more here. Feel free to grab me directly to chat more!
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.
yep let me keep the refactorings in and remove the attempted test fix 👍
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.
...or may be not 😅 ..i think 62adf9a should correctly use the retry and the
TestAccWafRule_webACL
added for additional checking