Skip to content

GCP Fails to Fetch Cloud Run Services #5385

@bbernays

Description

@bbernays

Describe the Bug

When you try to sync GCP resource gcp_run_services you get the following error

ERR table resolver finished with error error="rpc error: code = PermissionDenied desc = Permission denied on resource project [PROJECT-NAME].\nerror details: name = ErrorInfo reason = CONSUMER_INVALID domain = googleapis.com metadata = map[consumer:projects/[PROJECT-NAME] service:run.googleapis.com]\nerror details: name = Help desc = Google developer console API key url = https://console.developers.google.com/project/[PROJECT-NAME]/apiui/credential" client=[PROJECT-NAME] module=cli table=gcp_run_services

This is because in the request we use the wildcard {-} to try and grab all locations...

	req := &pb.ListServicesRequest{
		Parent: "projects/" + c.ProjectId + "locations/-",
	}
	it := c.Services.RunServicesClient.ListServices(ctx, req)

This is explicitly not allowed per the documentation:

Required. The location and project to list resources on. Location must be a valid Google Cloud region, and cannot be the "-" wildcard

Expected Behavior

CQ should be grabbing all Cloud Run services for a project

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions