artifact

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCConfig

type GCConfig struct {
	// CheckInterval is how often to run the GC sweep (default: 1h)
	CheckInterval time.Duration
}

GCConfig holds configuration for artifact garbage collection.

func DefaultGCConfig

func DefaultGCConfig() GCConfig

DefaultGCConfig returns the default GC configuration.

type GCController

type GCController struct {
	Log    *slog.Logger
	EAC    *entityserver_v1alpha.EntityAccessClient
	Config GCConfig
	// contains filtered or unexported fields
}

GCController periodically archives artifacts that are no longer referenced by any AppVersion. Archiving (Status=ARCHIVED) is the signal the downstream image GC and blob GC key off to reclaim the image and its registry blobs.

Retention is reference-driven rather than age- or count-based: an artifact is kept exactly as long as some AppVersion still points at it. Because artifacts are deduplicated by manifest digest (many versions can share one artifact), an artifact survives until its last referencing version is pruned. The version retention GC (controllers/version) is what removes those references over time; this controller reacts to the result.

func (*GCController) RunGC

func (c *GCController) RunGC(ctx context.Context) (*GCResult, error)

RunGC archives every active artifact that no AppVersion references.

func (*GCController) Start

func (c *GCController) Start(ctx context.Context)

Start begins the periodic GC process.

func (*GCController) Stop

func (c *GCController) Stop()

Stop gracefully stops the controller.

type GCResult

type GCResult struct {
	// ArchivedArtifacts contains IDs of artifacts transitioned to archived
	ArchivedArtifacts []entity.Id
	// FailedArtifacts contains IDs and errors for artifacts that failed to update
	FailedArtifacts map[entity.Id]error
	// TotalArtifacts is the total number of active artifacts evaluated
	TotalArtifacts int
	// RetainedArtifacts is the number of artifacts kept active
	RetainedArtifacts int
}

GCResult contains information about artifacts processed during GC.

Jump to

Keyboard shortcuts

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