Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCaches ¶
func ClearCaches()
ClearCaches clears all package-level caches. This is primarily used for testing to ensure tests don't interfere with each other via cached values. Note: This only clears global caches. Component-scoped caches (blob, imageFiles) are automatically released when the component's context goes out of scope.
func WithComponentCache ¶ added in v0.8.120
WithComponentCache returns a new context with a fresh component-scoped cache. Use this to scope blob and image files caches to a single component evaluation. When the context goes out of scope, the cached data becomes eligible for GC.
Types ¶
type ComponentCache ¶ added in v0.8.120
type ComponentCache struct {
// contains filtered or unexported fields
}
ComponentCache holds per-component caches for heavy OCI data (blobs and image files). These are the two largest cache types — blobs can be 1-10 MB each, and image files can also be substantial. Scoping them per-component prevents unbounded memory growth when validating many components with unique image refs.
Lighter caches (manifests, descriptors, image indexes) remain global because they are small and benefit from cross-component sharing (e.g., shared task bundle manifests).