harbor images - return digest in container image

Bug: T408574

This change adds 2 parts;

  1. Add support for matching an image name with a specified digest

Return the canonical name, with digest as an alias in the Image object and update the matching logic to check both the name and alises (as we do for standard images).

This enables support for matching both tool-some-tool/some-container and tool-some-tool/some-container:latest@sha256:5b8c5641d2dbd7d849cacb39853141c00b29ed9f40af9ee946b6a6a715e637c3

The canonical name is left as tool-some-tool/some-container, which is used in some human readable places (such as toolforge jobs images).

  1. Add the artefact digest to the container url.

In the case that the 'fully qualified' image has been specified, e.g. via builds-api (soon components-api), then it gets passed through.

In the case that the canonical_name has been specified, the image in the runtime will be modified to include the digest.

As we parse this out in image_by_container_url it won't be directly exposed to the user, but will allow safe caching/a guarantee of the image run as desired.

Merge request reports

Loading