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.
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.