prune

package
v3.8.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2017 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DryRunPruner

type DryRunPruner struct{}

DryRunPruner prints information about each object that going to remove.

func (*DryRunPruner) DeleteBlob

func (p *DryRunPruner) DeleteBlob(ctx context.Context, dgst digest.Digest) error
func (p *DryRunPruner) DeleteManifestLink(ctx context.Context, svc distribution.ManifestService, reponame string, dgst digest.Digest) error

func (*DryRunPruner) DeleteRepository

func (p *DryRunPruner) DeleteRepository(ctx context.Context, reponame string) error

type Pruner

type Pruner interface {
	DeleteRepository(ctx context.Context, reponame string) error
	DeleteManifestLink(ctx context.Context, svc distribution.ManifestService, reponame string, dgst digest.Digest) error
	DeleteBlob(ctx context.Context, dgst digest.Digest) error
}

Pruner defines a common set of operations for pruning

type RegistryPruner

type RegistryPruner struct {
	StorageDriver driver.StorageDriver
}

RegistryPruner deletes objects.

func (*RegistryPruner) DeleteBlob

func (p *RegistryPruner) DeleteBlob(ctx context.Context, dgst digest.Digest) error

DeleteBlob removes a blob from the storage

func (p *RegistryPruner) DeleteManifestLink(ctx context.Context, svc distribution.ManifestService, reponame string, dgst digest.Digest) error

DeleteManifestLink removes a manifest link from the storage

func (*RegistryPruner) DeleteRepository

func (p *RegistryPruner) DeleteRepository(ctx context.Context, reponame string) error

DeleteRepository removes a repository directory from the storage

type Summary

type Summary struct {
	Blobs     int
	DiskSpace int64
}

Summary is cumulative information about what was pruned.

func Prune

func Prune(ctx context.Context, registry distribution.Namespace, registryClient client.RegistryClient, pruner Pruner) (Summary, error)

Prune removes blobs which are not used by Images in OpenShift.

On error, the Summary will contain what was deleted so far.

TODO(dmage): remove layer links to a blob if the blob is removed or it doesn't belong to the ImageStream. TODO(dmage): keep young blobs (docker/distribution#2297).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL