pipe-cd / pipe-cd/pipecd

bug(cloudrun): parseContainerImage fails to parse images with registry ports

Open
#6,571 4 comments 1 reaction 1 assignee View on GitHub

@zyzzmohit is already working on this.

Since Apr 15, 2026.

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

Description

What happened:
In pkg/app/piped/platformprovider/cloudrun/servicemanifest.go, the parseContainerImage function naively splits the image string by : to extract the image tag. However, if a user relies on a container image hosted in a registry that specifies a port (e.g., localhost:5000/repo/image:tag or my-registry.com:8443/app:v1), the function incorrectly splits the URI. This results in a misparsed name and an empty tag.

This causes functions like FindImageTag and FindArtifactVersions to return incorrect values or fail during a Cloud Run deployment pipeline if custom registry ports are used in the service manifest.

What you expected to happen:
The function should correctly isolate the registry/repository from the tag, utilizing a more robust parsing strategy (such as checking strings.LastIndex for the tag colon, or using a dedicated image parsing library) to safely accommodate registry ports.

How to reproduce it:
Running the existing parseContainerImage logic against an image with a port yields incorrect results:

n, t := parseContainerImage("localhost:5000/pipecd/helloworld:v0.1.0")
// Expected: Name: helloworld, Tag: v0.1.0
// Actual: Name: localhost, Tag: (empty)

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.