diff --git a/.changelog/5308.txt b/.changelog/5308.txt new file mode 100644 index 00000000000..f2fa5719827 --- /dev/null +++ b/.changelog/5308.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +iam: fixed request batching bug where failed requests would show unnecessary backslash escaping to the user. +``` diff --git a/google/batcher.go b/google/batcher.go index 3e701a07118..36aaccb16c4 100644 --- a/google/batcher.go +++ b/google/batcher.go @@ -3,10 +3,11 @@ package google import ( "context" "fmt" - "github.com/hashicorp/errwrap" "log" "sync" "time" + + "github.com/hashicorp/errwrap" ) const defaultBatchSendIntervalSec = 3 @@ -177,7 +178,7 @@ func (b *RequestBatcher) SendRequestWithTimeout(batchKey string, request *BatchR case resp := <-respCh: if resp.err != nil { return nil, errwrap.Wrapf( - fmt.Sprintf("Request %q returned error: {{err}}", request.DebugId), + fmt.Sprintf("Request `%s` returned error: {{err}}", request.DebugId), resp.err) } return resp.body, nil diff --git a/google/resource_iam_member.go b/google/resource_iam_member.go index 604c210d3b9..1c9ba8c9091 100644 --- a/google/resource_iam_member.go +++ b/google/resource_iam_member.go @@ -203,7 +203,7 @@ func resourceIamMemberCreate(newUpdaterFunc newResourceIamUpdaterFunc, enableBat } if enableBatching { err = BatchRequestModifyIamPolicy(updater, modifyF, config, - fmt.Sprintf("Create IAM Members %s %+v for %q", memberBind.Role, memberBind.Members[0], updater.DescribeResource())) + fmt.Sprintf("Create IAM Members %s %+v for %s", memberBind.Role, memberBind.Members[0], updater.DescribeResource())) } else { err = iamPolicyReadModifyWrite(updater, modifyF) }