worker

package
v0.0.0-...-c440590 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCleanup

func HandleCleanup(c Config)

HandleCleanup function

func PrintList

func PrintList(list ListResponse)

PrintList prints the report in a pretty table output

func PrintListCluster

func PrintListCluster(cat Catalog)

PrintListCluster prints the report in a pretty table output

func PrintListRepos

func PrintListRepos(cat Catalog)

PrintListRepos prints the report in a pretty table output

Types

type ByTimeCreated

type ByTimeCreated []Digest

ByTimeCreated implements sort.Interface for []Digest based on the TimeCreatedMs field.

func (ByTimeCreated) Len

func (a ByTimeCreated) Len() int

func (ByTimeCreated) Less

func (a ByTimeCreated) Less(i, j int) bool

Less interprets as i "is newer than" / "happened after" j

func (ByTimeCreated) Swap

func (a ByTimeCreated) Swap(i, j int)

type ByTimeUploaded

type ByTimeUploaded []Digest

ByTimeUploaded implements sort.Interface for []Digest based on the TimeUploadedMs field.

func (ByTimeUploaded) Len

func (a ByTimeUploaded) Len() int

func (ByTimeUploaded) Less

func (a ByTimeUploaded) Less(i, j int) bool

Less interprets as i "is newer than" / "happened after" j

func (ByTimeUploaded) Swap

func (a ByTimeUploaded) Swap(i, j int)

type Catalog

type Catalog struct {
	Repositories []Repository `json:"repositories"`
}

Catalog holds info about all image repositories

func HandleListCluster

func HandleListCluster(c Config) Catalog

HandleListCluster function

func HandleListRepos

func HandleListRepos(c Config) Catalog

HandleListRepos function

type CatalogResponse

type CatalogResponse struct {
	Repositories []string               `json:"repositories"`
	Errors       []CatalogResponseError `json:"errors"`
}

CatalogResponse is the json api response

type CatalogResponseError

type CatalogResponseError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

CatalogResponseError holds info about a possible error

type Config

type Config struct {
	CredsFile       string   // path of credentials json file
	RepoFilter      []string // list of regions we want to check
	KeepTags        int
	RetentionDays   int
	KubeconfigPath  string
	RegistryURL     string
	SortBy          string
	ProtectTagRegex string
	DryRun          bool
}

Config is our application config for filtering, listing, cleaning

type Digest

type Digest struct {
	ImageSizeBytes string   `json:"imageSizeBytes"`
	LayerID        string   `json:"layerId"`
	MediaType      string   `json:"mediaType"`
	Tag            []string `json:"tag"`
	TimeCreatedMs  string   `json:"timeCreatedMs"`
	TimeUploadedMs string   `json:"timeUploadedMs"`
	Name           string
}

Digest holds info about image digest

type FilteredList

type FilteredList struct {
	TagsResponses []TagsResponse `json:"tagsResponses"`
}

FilteredList holds list of tags that were already filtered out

type ListResponse

type ListResponse struct {
	TagsResponses []TagsResponse `json:"tagsResponses"`
}

ListResponse is the json api response

func HandleList

func HandleList(c Config) ListResponse

HandleList function

type Repository

type Repository struct {
	RepositoryPrefix string
	ImageName        string
	Tag              string
}

Repository is our struct to hold parsed prefix, name, tag of image

type TagsResponse

type TagsResponse struct {
	Child    []interface{}     `json:"child"`
	Manifest map[string]Digest `json:"manifest"`
	Name     string            `json:"name"`
	Tags     []string          `json:"tags"`
}

TagsResponse is the json api response

Jump to

Keyboard shortcuts

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