Skip to content

Commit f5ddaef

Browse files
committed
chore: document CacheChains.Marshal
Signed-off-by: Justin Chadwell <[email protected]>
1 parent 39ad6e0 commit f5ddaef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cache/remotecache/v1/chains.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ func (c *CacheChains) normalize(ctx context.Context) error {
8181
return nil
8282
}
8383

84+
// Marshal converts the cache chains structure into a cache config and a
85+
// collection of providers for reading the results from.
86+
//
87+
// Marshal aims to validate, normalize and sort the output to ensure a
88+
// consistent digest (since cache configs are typically uploaded and stored in
89+
// content-addressable OCI registries).
8490
func (c *CacheChains) Marshal(ctx context.Context) (*CacheConfig, DescriptorProvider, error) {
8591
if err := c.normalize(ctx); err != nil {
8692
return nil, nil, err

0 commit comments

Comments
 (0)