GKE Connect Gateway gives 400

I think there’s a bug in google-cloud-gke-connect-gateway

While the below works (gkehub):


from google.cloud import gkehub_v1

client = gkehub_v1.GkeHubClient()
membership_name = f'projects/{project_id}/locations/{membership_location}/memberships/{membership_id}'
request = gkehub_v1.GetMembershipRequest(name=membership_name)
response = client.get_membership(request=request)
assert response.name == membership_name

print(response)

The corresponding gkeconnect code doesn’t work


from google.cloud.gkeconnect import gateway_v1

client = gateway_v1.GatewayControlClient()
request = gateway_v1.GenerateCredentialsRequest(name=membership_name,)
response = client.generate_credentials(request=request)
print(response)

> BadRequest: 400 GET [https://connectgateway.googleapis.com/v1/projects/myproject/locations/us-east1/memberships/cluster-dev-us-e1-abcdef:generateCredentials?%24alt=json%3Benum-encoding%3Dint](https://connectgateway.googleapis.com/v1/projects/myproject/locations/us-east1/memberships/cluster-dev-us-e1-abcdef:generateCredentials?%24alt=json%3Benum-encoding%3Dint): Request contains an invalid argument.

Am I doing something wrong? Or is there actually a bug in the client?

Hi @DonkeyTimes ,

Welcome to Google Cloud Community!

Please note that there is a known issue related to Error 400 (Bad Request), which generally means the request is malformed or invalid—often due to incorrect syntax, missing required fields, invalid resource names or IDs, or unsupported values. You can find a suggested workaround for the issue on this link.

For further guidance and assistance, you can reach out to Google Cloud Support at any time.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.