Skip to content

bug(cloudrun): fix parseContainerImage to handle images with registry…#6572

Open
zyzzmohit wants to merge 2 commits intopipe-cd:masterfrom
zyzzmohit:feat/cloudrun-image-parse-fix
Open

bug(cloudrun): fix parseContainerImage to handle images with registry…#6572
zyzzmohit wants to merge 2 commits intopipe-cd:masterfrom
zyzzmohit:feat/cloudrun-image-parse-fix

Conversation

@zyzzmohit
Copy link

What this PR does:
This PR addresses a parsing issue within pkg/app/piped/platformprovider/cloudrun/servicemanifest.go. The previous implementation of parseContainerImage naively split the image URI by : to find the tag, which broke when a service manifest utilized an image from a custom Docker registry containing a port (e.g., localhost:5000/image:tag).

The new implementation isolates the last segment of the URI path and correctly searches for the tag's delimiter strictly using strings.LastIndex.

I have also added multiple dedicated unit test cases in servicemanifest_test.go for both FindImageTag and FindArtifactVersions to guarantee this behavior.

Why we need it:
Cloud Run services referencing images using custom registry ports will now correctly deploy without parsing errors during the repository artifact retrieval phase.

Which issue(s) this PR fixes:
Fixes #6571

Does this PR introduce a user-facing change?:

  • How are users affected by this change: No direct UX changes. Users deploying Cloud Run applications from private registries with custom ports will no longer experience failed deployments.
  • Is this breaking change: No.
  • How to migrate (if breaking change): N/A

… ports

Signed-off-by: zyzzmohit <mohitray949@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant