Manifest list merger

This class handles the merging of manifest lists, as well as other use-cases which require manifest list modifications.

class pubtools._quay.manifest_list_merger.ManifestListMerger(src_image: str, dest_image: str, src_quay_host: Optional[str] = None, src_quay_username: Optional[str] = None, src_quay_password: Optional[str] = None, dest_quay_username: Optional[str] = None, dest_quay_password: Optional[str] = None, host: Optional[str] = None)[source]

Class containing logic for merging manifest lists of two images.

merge_manifest_lists() None[source]

Merge manifest lists and upload to Quay. Main entrypoint method.

__init__(src_image: str, dest_image: str, src_quay_host: Optional[str] = None, src_quay_username: Optional[str] = None, src_quay_password: Optional[str] = None, dest_quay_username: Optional[str] = None, dest_quay_password: Optional[str] = None, host: Optional[str] = None) None[source]

Initialize.

Args:
src_image (str):

Address to a new image whose manifest list contains the newer data.

dest_image (str):

Address to an older image whose data will be overwritten.

src_quay_host (str):

Custom hostname to connect to use for pulling src_image.

src_quay_username (str):

Quay username to get src_image. If ommited, external client instance should be set.

src_quay_password (str):

Quay password to get src_image. If ommited, external client instance should be set.

dest_quay_username (str):

Quay username to get dest_image. If ommited, external client instance should be set.

dest_quay_password (str):

Quay password to get dest_image. If ommited, external client instance should be set.

host (str):

Custom hostname to connect to. If ommited, standard quay.io will be used.

set_quay_clients(src_quay_client: QuayClient, dest_quay_client: QuayClient) None[source]

Set client instances to be used for the HTTP API operations.

Args:
src_quay_client (QuayClient):

Instance of QuayClient.

dest_quay_client (QuayClient):

Instance of QuayClient.

static get_missing_architectures(src_manifest_list: ManifestList, dest_manifest_list: ManifestList) List[Manifest][source]

Get architectures which are missing from the new source image.

NOTE: this method assumes that images are built only for one OS. The following logic would need to be overwritten if multiple OS builds started to be made.

Args:
src_manifest_list (dict):

Manifest list of the source image.

dest_manifest_list (dict):

Manifest list of the destination image.

Returns ([dict]):

List of arch manifest data present in destination image but missing from source.

_add_missing_architectures(src_manifest_list: ManifestList, missing_archs: List[Manifest]) ManifestList[source]

Add missing architectures to the source manifest list.

Args:
src_manifest_list (dict):

Source manifest list.

missing_archs ([dict]):

Manifest data of missing architectures.

Retuns (dict):

New manifest list containing all the architectures.

merge_manifest_lists_selected_architectures(eligible_archs: List[str]) ManifestList[source]

Merge manifests lists. Only specified archs are eligible for merging.

This is an alternate workflow used in ‘tag-docker’.

Args:
eligible_archs ([str]):

Archs eligible for merging with the old manifest list.

Returns (dict):

New manifest list.