Resolve pipeline resources from their source locations
This commit is contained in:
@@ -4,8 +4,6 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -53,7 +51,7 @@ func recomputePipelineEffectiveDigest(cfg *PipelineConfig) error {
|
||||
if cfg == nil || cfg.resolution == nil {
|
||||
return fmt.Errorf("pipeline resolution metadata is required")
|
||||
}
|
||||
canonical, err := projectionJSON(projectEffectivePipeline(cfg, true))
|
||||
canonical, err := projectionJSON(projectEffectivePipeline(cfg))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -62,25 +60,3 @@ func recomputePipelineEffectiveDigest(cfg *PipelineConfig) error {
|
||||
cfg.resolution.effectiveDigest = hex.EncodeToString(digest[:])
|
||||
return nil
|
||||
}
|
||||
|
||||
// captureLogicalNotariusPaths retains normalized user-facing path semantics
|
||||
// before runtime resolution makes relative paths depend on the checkout or
|
||||
// installation directory. Runtime paths remain absolute; provenance does not.
|
||||
func captureLogicalNotariusPaths(cfg *PipelineConfig) {
|
||||
if cfg == nil || cfg.resolution == nil || cfg.Notarius == nil {
|
||||
return
|
||||
}
|
||||
configPath := normalizeLogicalFilesystemPath(cfg.Notarius.ConfigPath)
|
||||
workingDirectory := normalizeLogicalFilesystemPath(cfg.Notarius.WorkingDirectory)
|
||||
cfg.resolution.logicalNotariusConfig = configPath
|
||||
cfg.resolution.logicalNotariusWorking = workingDirectory
|
||||
cfg.resolution.logicalNotariusCaptured = true
|
||||
}
|
||||
|
||||
func normalizeLogicalFilesystemPath(value string) string {
|
||||
value = strings.TrimSpace(value)
|
||||
if value == "" {
|
||||
return ""
|
||||
}
|
||||
return filepath.ToSlash(filepath.Clean(value))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user