gcrgc

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the main application

func NewApp

func NewApp(s *Settings) *App

NewApp creates a new instance of the application

func (*App) Start

func (app *App) Start()

Start the application

type GCR

type GCR struct {
	// contains filtered or unexported fields
}

GCR abstracts the google/go-containerregistry SDK

func NewGCR

func NewGCR(auth authn.Authenticator) *GCR

NewGCR creates a new instance of GCloud

func (GCR) DeleteImage

func (g GCR) DeleteImage(repo string, i *docker.Image, dryRun bool)

DeleteImage deletes an image

func (GCR) ListImages

func (g GCR) ListImages(reponame string, limit time.Time) []docker.Image

ListImages gets the list of images for the given repository name

func (GCR) ListRepositories

func (g GCR) ListRepositories(registry string) []docker.Repository

ListRepositories gets the list of repositories for current registry

type ImageFilter

type ImageFilter interface {
	// Apply should return true if the image should be planned for deletion
	Apply(i *docker.Image) bool
}

ImageFilter is an interface for docker image filters

type SemVerTagNameFilter

type SemVerTagNameFilter struct {
	// contains filtered or unexported fields
}

SemVerTagNameFilter compares the image tags against regular expressions from the exclusion list.

func NewSemVerTagNameFilter

func NewSemVerTagNameFilter(enabled bool) *SemVerTagNameFilter

NewSemVerTagNameFilter creates a new SemVerTagNameFilter

func (*SemVerTagNameFilter) Apply

func (f *SemVerTagNameFilter) Apply(img *docker.Image) bool

Apply returns true if if no tag was in the exclusion list.

type Settings

type Settings struct {
	Registry             string
	Repositories         []string
	Date                 time.Time
	UntaggedOnly         bool
	DryRun               bool
	AllRepositories      bool
	ExcludedRepositories []string
	ExcludedTags         []string
	ExcludedTagPatterns  []string
	ExcludeSemVerTags    bool
}

Settings contains app Configuration

type TagNameFilter

type TagNameFilter struct {
	// contains filtered or unexported fields
}

TagNameFilter compares the image tags against the exclusion list.

func (TagNameFilter) Apply

func (f TagNameFilter) Apply(img *docker.Image) bool

Apply returns true if if no tag was in the exclusion list.

type TagNameRegexFilter

type TagNameRegexFilter struct {
	// contains filtered or unexported fields
}

TagNameRegexFilter compares the image tags against regular expressions from the exclusion list.

func NewTagNameRegexFilter

func NewTagNameRegexFilter(patterns []string) *TagNameRegexFilter

NewTagNameRegexFilter creates a new SemVerTagNameFilter

func (TagNameRegexFilter) Apply

func (f TagNameRegexFilter) Apply(img *docker.Image) bool

Apply returns true if if no tag was in the exclusion list.

type UntaggedFilter

type UntaggedFilter struct {
	// contains filtered or unexported fields
}

UntaggedFilter filters images that have no tag

func (UntaggedFilter) Apply

func (f UntaggedFilter) Apply(img *docker.Image) bool

Apply returns true when the image has no tags

Jump to

Keyboard shortcuts

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