main bac21c6

images.go RawHistoryFolder

1package domain
2
3import "time"
4
5const DefaultImagePruneKeepLast = 3
6
7// ImagePruneOptions controls which prune subsystems are activated.
8type ImagePruneOptions struct {
9	// KeepLast is the number of most-recent non-latest tags to retain per repository.
10	KeepLast int
11	// PruneDangling enables runtime dangling image cleanup.
12	PruneDangling bool
13	// PruneRegistry enables registry tag retention and blob garbage collection.
14	PruneRegistry bool
15	// DryRun plans everything and deletes nothing.
16	DryRun bool
17}
18
19// DefaultImagePruneOptions returns options that prune both scopes with the default retention.
20func DefaultImagePruneOptions() ImagePruneOptions {
21	return ImagePruneOptions{
22		KeepLast:      DefaultImagePruneKeepLast,
23		PruneDangling: true,
24		PruneRegistry: true,
25	}
26}
27
28// ImagePruneConfig defines scheduled image cleanup behavior.
29type ImagePruneConfig struct {
30	Enabled  bool
31	Schedule BackupSchedule
32	// KeepLast is the number of most-recent non-latest tags to retain per repository.
33	// The latest tag is retained separately when present.
34	KeepLast int
35}
36
37// RuntimePruneResult reports runtime image cleanup results.
38type RuntimePruneResult struct {
39	DeletedCount int
40	// SpaceReclaimed is reported in bytes.
41	SpaceReclaimed int64
42}
43
44// RegistryPruneResult reports registry cleanup results.
45type RegistryPruneResult struct {
46	TagsRemoved  int
47	BlobsRemoved int
48	// SpaceReclaimed is reported in bytes.
49	SpaceReclaimed int64
50	// UploadsRemoved is the number of stale upload files removed.
51	UploadsRemoved int
52	// UploadSpaceReclaimed is bytes recovered from stale uploads.
53	UploadSpaceReclaimed int64
54}
55
56// ImagePruneReport aggregates runtime and registry cleanup results.
57type ImagePruneReport struct {
58	Runtime  RuntimePruneResult
59	Registry RegistryPruneResult
60	// Plan carries every candidate's verdict, the inventory gaps, and
61	// the applied flag. Dry-run and execution share this shape.
62	Plan PruneReport
63}
64
65// ImageInfo describes an image/tag visible from runtime and registry data.
66type ImageInfo struct {
67	Repository string
68	Tag        string
69	// Size is reported in bytes.
70	Size    int64
71	Created time.Time
72	// ID is the runtime image identifier (for example, image ID/digest).
73	ID       string
74	Dangling bool
75}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close