cli.contributing.mirror package

Subpackages

Submodules

cli.contributing.mirror.model module

class cli.contributing.mirror.model.ImageRef(role: str, service: str, name: str, version: str, source: str, registry: str = 'docker.io', source_file: str = 'meta/services.yml')

Bases: object

Role-declared container image reference.

Fields:

role: e.g. svc-db-postgres service: e.g. postgres name: canonical image name without registry, e.g. postgis/postgis version: e.g. 17-3.5 source: full pull ref, e.g. docker.io/library/postgres:16 registry: source registry hostname, e.g. docker.io, quay.io source_file: file the ref was read from, role-relative for a role

image and repository-relative for a runner image

name: str
registry: str = 'docker.io'
role: str
service: str
source: str
source_file: str = 'meta/services.yml'
version: str

cli.contributing.mirror.providers module

class cli.contributing.mirror.providers.GHCRProvider(namespace: str, repository: str, prefix: str = 'mirror')

Bases: RegistryProvider

classmethod add_args(parser: argparse.ArgumentParser) → None

Register –ghcr-namespace, –ghcr-repository, –ghcr-prefix on parser.

classmethod from_args(args: argparse.Namespace) → GHCRProvider

Construct a GHCRProvider from parsed CLI args.

image_base(image: ImageRef) → str
mirror(image: ImageRef) → None
tag_exists(image: ImageRef) → bool

Return True if the destination tag already exists in GHCR.

Uses: skopeo inspect docker://<dest> Exit code:

  • 0 => exists

  • !=0 => does not exist OR cannot be accessed (auth/network)

class cli.contributing.mirror.providers.GiteaProvider(registry: str, namespace: str, prefix: str = 'mirror')

Bases: RegistryProvider

image_base(image: ImageRef) → str
mirror(image: ImageRef) → None
tag_exists(image: ImageRef) → bool

Return True if the destination tag already exists in the target registry.

Uses: skopeo inspect docker://<dest> Exit code:

  • 0 => exists

  • !=0 => does not exist OR cannot be accessed (auth/network)

class cli.contributing.mirror.providers.RegistryProvider

Bases: ABC

abstractmethod image_base(image: ImageRef) → str
abstractmethod mirror(image: ImageRef) → None
abstractmethod tag_exists(image: ImageRef) → bool

Module contents