-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
application_insights_api_key - Fixes infinite loop while checking for existing api keys #28037
application_insights_api_key - Fixes infinite loop while checking for existing api keys #28037
Conversation
…existing api keys
Open questions from my side:
|
Would it make sense to add an |
I also wonder if the original |
Thanks for your reply. I am not 100% familiar with the appinisghts go and the azure client go sdk. Can you quickly explain why you think the If there is an api-key which is not under terraform state control and also not defined as a future resource this for loop will poll indefinitely. |
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.
Looks like I introduced this bug when swapping the appinsights
service over to using our SDK, sorry 😓! This should definitely not be looping on those conditions.
Thanks for fixing this @TwinbrotherPro! LGTM ⚡
Thanks for taking over @stephybun. Looking forward to v4.12.0 👍 |
Community Note
Description
If there are already existing API Keys present in the given appinsights resource which should not be managed by Terraform the code does no break in the given for loop as we never run into one of the two error cases.
I think the reason for this infinite outer for loop is that it actually is a typo and is meant to be an
if
statement. Which would fix the bug and make much more sense in my eyes.PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
application_insights_api_key
- fix infinite loop while checking for existing api keysThis is a (please select all that apply):
Related Issue(s)
Note
If this PR changes meaningfully during the course of review please update the title and description as required.