Push items: containers

class pushsource.ContainerImagePushItem[source]

A PushItem representing a container image.

This item represents any kind of image which can be pulled from a container image registry (i.e. an object identified by a NAME[:TAG|@DIGEST] string).

In the case of a multi-arch image, one ContainerImagePushItem represents an image for a single architecture only.

Attributes:

dest_signing_key

Desired signing key for this container image.

Typically a 16-character identifier for a signing key, such as "199e2f91fd431d51", though the format is not enforced by this library.

A non-empty value for this attribute should be interpreted as a request to use the specified key to generate signatures for this image’s manifest(s). See container-signature docs for information on signatures.

Type:

str

source_tags

Tags placed onto this image when it was built, if known.

Type:

List[str]

labels

Labels of this image, if known.

This field is not guaranteed to include all labels associated with the image.

Type:

Dict[str, str]

arch

Architecture of this image, if known.

This field uses the conventional architecture strings used throughout the container ecosystem, such as "amd64".

Type:

str

pull_info

Metadata for pulling this image from a registry.

Type:

ContainerImagePullInfo

product_name

Name of the product of this image.

Brew doesn’t provide this information, so it may not be set if the push items are only generated from brew. This information will be included in the “container security manifests” (formerly known as SBOMs).

Type:

str

class pushsource.SourceContainerImagePushItem[source]

A PushItem representing a source container image.

Source container images are a special type of image which are not runnable but instead contain the packaged source code of a related binary image.

See this article for more information on source container images.

Attributes:

class pushsource.ContainerImagePullInfo[source]

Information needed to access a container image from a registry.

Attributes:

tag_specs

Pull specs to access this image by tag.

This may include specs which refer to a manifest list referencing this image, and also specs which refer directly to the image manifest for this image.

This field always contains at least one pull spec. If you don’t care which tag you use, it’s reasonable to use item.pull_info.tag_specs[0].

Note that, as all tags are mutable, it’s possible for this information to be outdated. It is recommended to pull by digest or at least cross-reference with digests.

Type:

List[ContainerImageTagPullSpec]

digest_specs

Pull specs to access this image by manifest digest.

This may include specs which refer to a manifest list referencing this image, and also specs which refer directly to the image manifest for this image.

These specs are always ordered from most to least preferred manifest type, which means:

  • manifest list if available, else:

  • schema2 image manifest if available, else:

  • schema1 image manifest

Type:

List[ContainerImageDigestPullSpec]

media_types

All media types for which a manifest is reachable in digest_specs().

For information on these types see the image manifest spec.

Type:

List[str]

digest_spec_for_type(media_type)[source]

Get the digest spec for a specific media type, if available.

Parameters:

media_type (str) – a MIME type string identifying a type of image manifest or manifest list, e.g. “application/vnd.docker.distribution.manifest.v2+json”

Returns:

ContainerImageDigestPullSpec

if a digest of the requested type is available

None

if a digest of the requested type is not available

class pushsource.ContainerImagePullSpec[source]

A container image pull spec in parsed form.

Pull spec refers to a "NAME[:TAG|@DIGEST]" string used to pull a container image. This class provides a pull spec both in raw string form and parsed into various components, along with information on the available media type.

Attributes:

registry

Registry component of pull spec.

Example: in "registry.access.redhat.com/ubi8/ubi-minimal:latest", the registry is "registry.access.redhat.com".

Type:

str

repository

Repository component of pull spec.

Example: in "registry.access.redhat.com/ubi8/ubi-minimal:latest", the repository is "ubi8/ubi-minimal".

Type:

str

class pushsource.ContainerImageDigestPullSpec[source]

A container image pull spec using a manifest digest.

Attributes:

digest

Digest component of pull spec.

Example: in "registry.access.redhat.com/ubi8/ubi-minimal@sha256:0ccb9988abbc72d383258d58a7f519a10b637d472f28fbca6eb5fab79ba82a6b", the digest is "sha256:0ccb9988abbc72d383258d58a7f519a10b637d472f28fbca6eb5fab79ba82a6b".

Type:

str

media_type

Media type of the manifest obtained by this pull spec, if known.

Generally, the media type is known for all digest pull specs obtained via koji. It can be checked to determine whether a pull spec refers to a manifest list or an image manifest.

Example: "application/vnd.docker.distribution.manifest.v2+json"

Type:

str

class pushsource.ContainerImageTagPullSpec[source]

A container image pull spec using a tag.

Attributes:

tag

Tag component of pull spec.

Example: in "registry.access.redhat.com/ubi8/ubi-minimal:latest", the tag is "latest".

Type:

str

media_types

Media type(s) expected to be reachable via this tag, or empty if unknown.

Generally, the media types are only known for manifest lists obtained from a koji build.

Example: ["application/vnd.docker.distribution.manifest.list.v2+json"]

Type:

List[str]

class pushsource.OperatorManifestPushItem[source]

A PushItem representing an operator manifests archive (typically named operator_manifests.zip).

Attributes:

related_images

Operator related images obtained from a koji build.

Type:

List[str]

container_image_items

List of related container image push items.

Type:

List[ContainerImagePushItem]