Untag images

Entrypoint used for removing tags (images) from Quay. The script will refuse to perform the removal if a last reference of an image is to be removed. This may be overruled by specifying the –remove-last flag.

CLI reference

usage: pubtools-quay-untag [-h] --reference REFERENCE [--remove-last]
                           [--quay-api-token QUAY_API_TOKEN]
                           [--quay-user QUAY_USER]
                           [--quay-password QUAY_PASSWORD]

Named Arguments

--reference

Image reference to untag. Must be specified by tag. Multiple can be specified.

--remove-last

Whether to remove a tag even if it’s the last reference of some image.

--quay-api-token

OAuth token for Quay REST API.

--quay-user

Username for Quay login.

--quay-password

Password for Quay. Can be specified by env variable QUAY_PASSWORD.

API reference

pubtools._quay.untag_images.untag_images(references: List[str], quay_api_token: str, remove_last: bool = False, quay_user: Optional[str] = None, quay_password: Optional[str] = None) None[source]

Untag images from Quay.

Args:
references ([str]):

List of image references to untag.

quay_api_token (str):

OAuth token for authentication of Quay REST API.

remove_last (bool):

Whether to remove a tag when it’s the last reference of an image (in that repo).

quay_user (str):

Quay username for Docker HTTP API.

quay_password (str):

Quay password for Docker HTTP API.

Examples

Untag multiple images

$ export QUAY_PASSWORD=token
$ export QUAY_API_TOKEN=oauth_token
$ pubtools-quay-tag-image \
  --reference quay.io/src/image:1 \
  --reference quay.io/src/image:2 \
  --quay-user quay+username \
  --remote-exec \
  --ssh-remote-host 127.0.0.1 \
  --ssh-remote-host-port 2222 \
  --ssh-username user \
  --ssh-key-filename /path/to/file.key \

Untag an image and force the operation in case the tag is a last reference of some digest.

$ export QUAY_PASSWORD=token
$ export QUAY_API_TOKEN=oauth_token
$ pubtools-quay-tag-image \
  --reference quay.io/src/image:1 \
  --remove-last \
  --quay-user quay+username