Skip to content

Commit

Permalink
fix: source when reading from cache
Browse files Browse the repository at this point in the history
Signed-off-by: Yves Brissaud <[email protected]>
  • Loading branch information
eunomie committed Oct 14, 2024
1 parent 9d9c14f commit eb09bf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion runkit/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewLocalCache(cli command.Cli) *LocalCache {
}
}

func (c *LocalCache) Get(digest string) (*RunKit, error) {
func (c *LocalCache) Get(digest, src string) (*RunKit, error) {
rk := &RunKit{
Files: make(map[string]string),
}
Expand Down Expand Up @@ -66,6 +66,7 @@ func (c *LocalCache) Get(digest string) (*RunKit, error) {
}

if found {
rk.src = src
return rk, nil
}
return nil, nil
Expand Down
4 changes: 2 additions & 2 deletions runkit/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type (
}

Cache interface {
Get(digest string) (*RunKit, error)
Get(digest, src string) (*RunKit, error)
Set(digest string, runxConfig, runxDoc []byte) error
}
)
Expand Down Expand Up @@ -60,7 +60,7 @@ func Get(ctx context.Context, cache Cache, src string) (*RunKit, error) {

indexDigest = desc.Digest.String()

cached, err = cache.Get(indexDigest)
cached, err = cache.Get(indexDigest, src)
if err == nil && cached != nil {
return cached, nil
}
Expand Down

0 comments on commit eb09bf9

Please sign in to comment.