spinnaker: CloudBuild private worker pool not found

I’m trying to run a GCB (Google Cloud Build) step as a text build definition source, but when executing the stage it errors.

Example manifest:

steps:
  - args:
      - '-c'
      - 'echo hello'
    entrypoint: bash
    name: gcr.io/cloud-builders/git
options:
  pool:
    name: projects/PROJECT_NAME/locations/REGION/workerPools/WORKER_POOL_NAME

So I’m trying to run this GCB using a private worker pool (names have been obfuscated) which does exist, but when running via Spinnaker results in the following error (found via the execution source):

"errors" : [ {
    "domain" : "global",
    "message" : "workerpool not found: \"PATH_TO_WORKER_POOL"",
    "reason" : "notFound"

Using gcloud locally the manifest runs perfectly fine.

After some Googling it would appear that some clients need to support overriding the region (or endpoint) in which GCB runs: https://issuetracker.google.com/issues/193685195?pli=1

I’m my specific use case I need to run the manifest as a text based source so that I can inject Spinnaker parameters, which I don’t think is possible when using a pre-defined trigger.

Any help would be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18 (1 by maintainers)

Most upvoted comments

I am not sure how spinnaker works, but I hit the same problem while trying to use CloudBuild from Google Workflows. What I found out, after some research and trial and error, is that there are two different endpoints in the Cloud Build API to create build jobs:

  1. POST https://cloudbuild.googleapis.com/v1/projects/{projectId}/builds (link here)
  2. POST https://cloudbuild.googleapis.com/v1/{parent=projects/*/locations/*}/builds (link here)

Apparently, the first endpoint doesn’t have visibility to Worker Pools because they are on a different location. If, on the other hand, you use the second endpoint with the same location as the one of the Worker Pool, it should work as expected.

Thank you SO much @russellrc-keebo for this comment. I was absolutely at my wit’s end with this issue.

I am not sure how spinnaker works, but I hit the same problem while trying to use CloudBuild from Google Workflows. What I found out, after some research and trial and error, is that there are two different endpoints in the Cloud Build API to create build jobs:

  1. POST https://cloudbuild.googleapis.com/v1/projects/{projectId}/builds (link here)
  2. POST https://cloudbuild.googleapis.com/v1/{parent=projects/*/locations/*}/builds (link here)

Apparently, the first endpoint doesn’t have visibility to Worker Pools because they are on a different location. If, on the other hand, you use the second endpoint with the same location as the one of the Worker Pool, it should work as expected.

I don’t suppose anyone else is running into this issue or can think of a work around?

We need to run Google Cloud Build manifests via Spinnaker, but can’t due to the need for said manifests to use private worker pools.