From 9d63bae2aefc39ffa195163da921c79dc1225cc2 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 24 Sep 2024 19:09:06 +0200 Subject: [PATCH] Really resolve the link, not just get a relative link (#558) Signed-off-by: Itxaka --- pkg/config/spec.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/config/spec.go b/pkg/config/spec.go index 917eae6f..9716f4a0 100644 --- a/pkg/config/spec.go +++ b/pkg/config/spec.go @@ -55,7 +55,8 @@ func resolveTarget(fs v1.FS, target string) (string, error) { if strings.Contains(target, "partlabel") || strings.Contains(target, "partuuid") { return "", fmt.Errorf("target contains 'parlabel' or 'partuuid', looks like its a partition instead of a disk: %s", target) } - device, err := fs.Readlink(target) + // Use EvanSymlinks to properly resolve the target + device, err := filepath.EvalSymlinks(target) if err != nil { return "", fmt.Errorf("failed to read device link for %s: %w", target, err) }