GoogleCloudPlatform / golang-samples

Sample apps and code written for Google Cloud in the Go programming language.
Apache License 2.0
4.32k stars 1.75k forks source link

(TPU) Type mismatch for DeleteNode operation #4422

Open BigBlackWolf opened 1 month ago

BigBlackWolf commented 1 month ago

In which file did you encounter the issue?

https://github.com/googleapis/google-cloud-go/blob/main/tpu/apiv1/auxiliary.go#L101

Did you change the file? If so, how?

I am trying to wait result from operation of DeleteNode() in PR

Describe the issue

Delete operation return the wrong type. Expected type to response is var resp tpupb.Node, however DeleteNodeOperation.lro.proto.Result.Operation_Response.Response.TypeUrl has value type.googleapis.com/google.protobuf.Empty. Therefor code the following code:

op, err := client.DeleteNode(ctx, req)
if err != nil {
    return err
}
node, err := op.Wait(ctx) // raises here
if err != nil {
    return err
}

Causes an error: proto: mismatched message type: got "google.cloud.tpu.v1.Node", want "google.protobuf.Empty