cleanup

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterActiveImageTags

func FilterActiveImageTags(ctx context.Context, namespace string, imageName string, imageStreamTags []string, matchingTags *[]string) ([]string, error)

FilterActiveImageTags first gets all actively used image tags from imageStreamTags, then filters them out from matchingTags

func FilterByRegex

func FilterByRegex(imageTags *[]string, regexp *regexp.Regexp) []string

FilterByRegex returns the tags that match the regexp

func FilterImageTagsByTime

func FilterImageTagsByTime(imageStreamObjectTags *[]imagev1.NamedTagEventList, olderThan time.Time) []string

FilterImageTagsByTime returns the tags which are older than the specified time

func FilterOrphanImageTags

func FilterOrphanImageTags(gitValues, imageTags *[]string, matchOption MatchOption) []string

FilterOrphanImageTags returns the tags that do not have any git commit match

func GetInactiveImageTags

func GetInactiveImageTags(activeTags, allImageTags *[]string) []string

GetInactiveImageTags returns the tags without active tags (unsorted)

func GetMatchingTags

func GetMatchingTags(gitTags, imageTags *[]string, matchOption MatchOption) []string

GetMatchingTags returns all image tags matching one of the provided git tags

func LimitTags

func LimitTags(tags *[]string, keep int) []string

LimitTags returns the tags which should not be kept by removing the first n tags

Types

type MatchOption

type MatchOption string

MatchOption type defines how the tags should be matched

const (
	// MatchOptionExact for exact matches
	MatchOptionExact MatchOption = "exact"
	// MatchOptionPrefix for prefix matches
	MatchOptionPrefix MatchOption = "prefix"
)

Jump to

Keyboard shortcuts

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