Skip to content

bug(lambda): parseContainerImage fails to parse images with registry ports #6577

@zyzzmohit

Description

@zyzzmohit

What happened:

In pkg/app/piped/platformprovider/lambda/function.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 is the exact same parsing bug recently identified and fixed in the Cloud Run provider and the ECS provider. Because AWS Lambda container deployments may utilize custom Docker registries with ports, this is a necessary defensive fix mapping to real-world use cases and ensures parity across providers.

What you expected to happen:

The function should correctly isolate the registry/repository path from the tag using strings.LastIndex, properly handling images with registry ports.

How to reproduce it (as minimally and precisely as possible):

Deploy an AWS Lambda application using a function manifest that contains an image with a port in the registry URL:
image: localhost:5000/lambda-test:v0.0.1
Functions like FindArtifactVersions will fail to correctly parse it.

Anything else we need to know?:

I have already implemented the strings.LastIndex fix parity and added the necessary test coverage. I will link the PR below!

Environment:

  • PipeCD version: master

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions