Unify previous source resolution
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package stage
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -43,7 +44,7 @@ func hydratePreviousSessionArtifacts(
|
||||
if env.ArtifactStore == nil {
|
||||
return nil, fmt.Errorf("artifact store is required")
|
||||
}
|
||||
plan, err := previouscache.BuildPlan(ctx, env.Config, paths, requirements, env.ObjectStore)
|
||||
plan, err := previouscache.Resolve(ctx, env.Config, paths, requirements, env.ObjectStore)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -58,6 +59,10 @@ func hydratePreviousSessionArtifacts(
|
||||
}
|
||||
|
||||
if err := fileops.DownloadAndInstall(record.LocalPath, fileops.WorkspaceFileMode, func(destination io.Writer) error {
|
||||
if len(record.VerifiedContent) > 0 {
|
||||
_, err := io.Copy(destination, bytes.NewReader(record.VerifiedContent))
|
||||
return err
|
||||
}
|
||||
return storage.DownloadTo(ctx, env.ObjectStore, record.RemoteKey, destination)
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user