Skip to content

set ImageIdentifier.repository for custom registries#1163

Open
dansola wants to merge 1 commit into
mainfrom
danielsola/se-775-getimage-honor-custom-registry
Open

set ImageIdentifier.repository for custom registries#1163
dansola wants to merge 1 commit into
mainfrom
danielsola/se-775-getimage-honor-custom-registry

Conversation

@dansola

@dansola dansola commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Set ImageIdentifier.repository for custom registries

When checking whether an image already exists, tell the backend which repo to look in.

Why: for images built with clone(registry=...), the existence check (GetImage) was
implicitly looking in the cluster's default repo, never finding the image, so it rebuilt every
run. Now we pass the custom registry/repo explicitly via the new ImageIdentifier.repository
field so the lookup hits. (SE-775)

Default-repo images send an empty repository, so nothing changes for them. Pulled the
detection into a small _custom_repository() helper with a unit test.

Depends on the flyteidl2 release that includes ImageIdentifier.repository — needs a
flyteidl2 version bump here once it's out.

@dansola

dansola commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

IMAGE_TASK_DOMAIN = os.environ.get("FLYTE_IMAGEBUILDER_TASK_DOMAIN", "production")


def _custom_repository(repository: str) -> str:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could we rename it to _get_registry

def _custom_repository(repository: str) -> str:
# SE-775: for a custom registry override (clone(registry=...)) the image is pushed to a custom
# repo; tell GetImage to look there instead of the cluster's default repo. Empty for the default.
first_segment = repository.split("/", maxsplit=1)[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
first_segment = repository.split("/", maxsplit=1)[0]
registry = repository.split("/", maxsplit=1)[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants