Resolve supplied products from local records
This commit is contained in:
@@ -187,6 +187,14 @@ func ResolveSessionArtifact(paths SessionPaths, m *manifest.Manifest, source str
|
||||
return ResolvedSessionArtifact{}, err
|
||||
}
|
||||
spec := artifactRegistry[id]
|
||||
if m != nil && m.SuppliedProducts != nil {
|
||||
if record, ok := m.SuppliedProducts.Products[id]; ok {
|
||||
if err := ValidateSuppliedProduct(paths, id, spec.CanonicalRelPath, record); err != nil {
|
||||
return ResolvedSessionArtifact{}, fmt.Errorf("validate supplied %q: %w", id, err)
|
||||
}
|
||||
return ResolvedSessionArtifact{ID: id, Path: filepath.Join(paths.Root, filepath.FromSlash(record.Path)), ProducerStage: spec.ProducerStage, OutputKind: spec.OutputKind, Provenance: ArtifactProvenanceSupplied, Contract: cloneArtifactContract(record.Contract), Checksum: record.Checksum, Size: record.Size}, nil
|
||||
}
|
||||
}
|
||||
|
||||
candidate, err := manifestArtifactCandidate(paths, m, spec)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user