diff --git a/runkit/cache.go b/runkit/cache.go index e41465b..bea6fd7 100644 --- a/runkit/cache.go +++ b/runkit/cache.go @@ -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), } @@ -66,6 +66,7 @@ func (c *LocalCache) Get(digest string) (*RunKit, error) { } if found { + rk.src = src return rk, nil } return nil, nil diff --git a/runkit/read.go b/runkit/read.go index 74fa5da..99fb413 100644 --- a/runkit/read.go +++ b/runkit/read.go @@ -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 } ) @@ -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 }