ImagesManager#

class nublado.services.images.ImagesManager#

Bases: Generic

Base class defining the shared API for images managers.

There are separate implementations of the images manager API for each image source. This class provides the common API.

Methods Summary

delete_tags(config, tags)

Delete the given tags.

list_tags(config)

List the available image tags in the repository.

prune_images(config, policy, *[, dry_run])

Prune the images excluded by a filter policy.

Methods Documentation

abstract async delete_tags(config, tags)#

Delete the given tags.

The underlying image will be deleted, even if the image also has other tags, so this will also delete other tags attached to the same image. Use with caution for images that may be tagged with recommended or other alias tags.

Parameters:
  • config (TypeVar(T, bound= TypeAliasType)) – Configuration for the repository.

  • tags (Iterable[str]) – Tags to delete.

Return type:

None

abstract async list_tags(config)#

List the available image tags in the repository.

Parameters:

config (TypeVar(T, bound= TypeAliasType)) – Configuration for the repository.

Returns:

Set of image tags.

Return type:

set of str

abstract async prune_images(config, policy, *, dry_run=True)#

Prune the images excluded by a filter policy.

The images that are not accepted by the filter policy will be deleted, at least to the extent that is possible in the target image registry.

Parameters:
  • config (TypeVar(T, bound= TypeAliasType)) – Configuration for the repository.

  • policy (ImageFilterPolicy) – Image filter policy describing what images to retain.

  • dry_run (bool, default: True) – If True, do not delete the images, only return which images would be deleted.

Returns:

Tags of deleted images, or images that would be deleted if dry_run is True, in standard sorted order.

Return type:

list of str