-
Notifications
You must be signed in to change notification settings - Fork 216
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
Adding Tag and Tag Assignment resources. Also Tag Data Source. #402
Conversation
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.
Nice work @stmcallister 🎉 I left a few inline comments 🙂
} | ||
log.Printf("[INFO] Deleting PagerDuty tag assignment with tagID %s for entityID %s", assignment.TagID, assignment.EntityID) | ||
|
||
retryErr := resource.Retry(10*time.Second, func() *resource.RetryError { |
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.
We could also return the result of Retry()
here I think like we do in the Read()
func 🙂
return resource.Retry(10*time.Second, func() *resource.RetryError {
if _, err := client.Tags.Assign(assignment.EntityType, assignment.EntityID, assignments); err != nil {
if isErrCode(err, 400) || isErrCode(err, 429) {
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
} else {
d.SetId("")
}
return 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.
@heimweh Isn't that what I'm doing on line 149?
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.
Oh yeah 🙈 but you could also just return the result directly I think, similar to this: https://github.com/PagerDuty/terraform-provider-pagerduty/pull/402/files#diff-8e5db2413fabc26d71cf3f5be3427fcade8bdd7d76ea78ba83f0f553886a24b0R103 🙂
Adding
pagerduty_tag
andpagerduty_tag_assignment
resources as well aspagerduty_tag
data source. Here are the test results for those additions.