Skip to content

Commit 880c5d2

Browse files
committed
resolving from PullCandidates struct
1 parent 5a63e2e commit 880c5d2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

common/imageutil.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ func CanonicalImageName(ref string) (string, error) {
2424
if err != nil {
2525
return "", fmt.Errorf("failed to resolve short name %q: %w", ref, err)
2626
}
27-
candidates := resolved.Candidates()
28-
if len(candidates) == 0 {
27+
if len(resolved.PullCandidates) == 0 {
2928
return "", fmt.Errorf("no resolution candidates found for short name %q", ref)
3029
}
31-
name = candidates[0].String() // take first candidate
32-
return name, nil // Already includes tag
30+
candidate := resolved.PullCandidates[0] // take first candidate
31+
return candidate.Value.String(), nil // Already includes tag
3332
}
3433

3534
return fmt.Sprintf("%s:%s", name, tag), nil

0 commit comments

Comments
 (0)