pipe-cd / pipe-cd/pipecd

Cannot deploy a docker image with its digest to Cloud Run.

Open
#5,688 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
1.4k
Forks
364
Avg merge
1d 4h
Merged PRs (30d)
84

Description

What happened:
If you specify a Docker image using the digest which has 64 characters and is calculated with SHA-256 algorithm as data in EventWatcher and configure the manifest side's service.yaml under piped monitoring to rewrite the container image deployed to the Cloud Run service in the handler, the service.spec.template.metadata.name can exceed 64 characters. As a result, this causes a BadRequest error and the deployment fails, as shown below.

[2025-03-17 12:10:58 +09:00]
Successfully prepared service manifest with traffic percentages as below:
[2025-03-17 12:10:58 +09:00]
  helloworld-1bd4d708f94fcfb58b51b3a0818edc52bcc079104fc0fa3347ff0f309f9ed8b2-ca1937a: 100
[2025-03-17 12:10:58 +09:00]
Start applying the service manifest
[2025-03-17 12:10:58 +09:00]
Failed to update the service helloworld (googleapi: Error 400: service.spec.template.metadata.name: only lowercase, digits, and hyphens; must begin with letter, and may not end with hyphen; must be less than 64 characters.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.BadRequest",
    "fieldViolations": [
      {
        "description": "only lowercase, digits, and hyphens; must begin with letter, and may not end with hyphen; must be less than 64 characters.",
        "field": "service.spec.template.metadata.name"
      }
    ]
  }
]
, badRequest)

What you expected to happen:
The deployment completes successfully even when the EventWatcher handler rewrites the Docker image with the digest.

How to reproduce it:

  1. Configure app.pipecd.yaml so that the EventWatcher handler rewrites $.spec.template.spec.containers[0].image in service.yaml under the application's Application Directory.

  2. In the CI workflow, execute actions-event-register with the corresponding name and labels, specifying the Docker image name using a digest as data in the EventWatcher matcher.

  3. Verify that the event has been registered successfully.

  4. Watch the log of the deployment.

Environment:

  • piped version: v0.50.2
  • control-plane version:v0.50.2
  • Others:
    • actions-event-register version: v0.50.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Cloud Run manifest generation path from the EventWatcher handler that rewrites service.yaml and constructs service.spec.template.metadata.name. Reproduce the failure with a 64-character SHA-256 image digest, then verify that the generated name stays within Cloud Run's length and character limits and that deployment succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.