Move Notarius path and executable resolution into its adapter

This commit is contained in:
2026-12-02 21:37:50 +00:00
parent 106036cf5b
commit d2f8b21c97
10 changed files with 106 additions and 58 deletions

View File

@@ -8,7 +8,6 @@ import (
"errors"
"fmt"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
@@ -91,7 +90,7 @@ func (extractStage) Run(ctx context.Context, env *Env, m *manifest.Manifest) (re
if err != nil || timeout <= 0 {
return nil, fmt.Errorf("extract: invalid notarius timeout %q", notariusConfig.Timeout)
}
resolvedBinary, err := resolveExecutable(notariusConfig.Binary)
resolvedBinary, err := notarius.ResolveExecutable(notariusConfig.Binary)
if err != nil {
return nil, fmt.Errorf("extract: resolve notarius binary: %w", err)
}
@@ -310,14 +309,6 @@ func extractionFingerprint(
return hex.EncodeToString(digest[:]), nil
}
func resolveExecutable(value string) (string, error) {
resolved, err := exec.LookPath(strings.TrimSpace(value))
if err != nil {
return "", err
}
return absolutePath(resolved)
}
func absolutePath(value string) (string, error) {
trimmed := strings.TrimSpace(value)
if trimmed == "" {