solver: avoid removing references required for future cache

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2017-07-20 15:55:24 -07:00
parent 34676f9175
commit 8b09e89dbb
6 changed files with 32 additions and 11 deletions

View File

@@ -78,7 +78,7 @@ func (gs *gitSource) mountRemote(ctx context.Context, remote string) (target str
initializeRepo := false
if remoteRef == nil {
remoteRef, err = gs.cache.New(ctx, nil, cache.CachePolicyKeepMutable)
remoteRef, err = gs.cache.New(ctx, nil, cache.CachePolicyRetain)
if err != nil {
return "", nil, errors.Wrapf(err, "failed to create new mutable for %s", remote)
}

View File

@@ -104,7 +104,7 @@ func (ls *localSourceHandler) Snapshot(ctx context.Context) (out cache.Immutable
}
if mutable == nil {
m, err := ls.cm.New(ctx, nil, cache.CachePolicyKeepMutable)
m, err := ls.cm.New(ctx, nil, cache.CachePolicyRetain)
if err != nil {
return nil, err
}