Skip to main content

ImageChecker

This class defines a protocol for verifying the existence of container images within a specified repository. It provides an asynchronous interface to check for specific image tags and architectures, returning the image identifier if found.

Methods


image_exists()

@classmethod
def image_exists(
repository: str,
tag: str,
arch: Tuple[Architecture, ...] = ("linux/amd64",)
) - > Optional[str]

Checks if a specific container image exists within a repository for the given architectures. Use this to verify image availability before attempting to pull or deploy a manifest.

Parameters

NameTypeDescription
repositorystrThe full name of the container repository to query
tagstrThe specific image tag or version identifier to look for
archTuple[Architecture, ...] = ("linux/amd64",)A tuple of supported CPU architectures to validate against the image manifest

Returns

TypeDescription
Optional[str]The digest of the image if it exists and matches the specified architectures, otherwise None