policy: fixes for image source handling

- Make sure tag is added to image reference as
containerd reference parser refuses to parse otherwise.

- When attestation is asked from non-index, return
nil instead of error. This is for consistency as likely
to fail in BuildKit before that is fixed separately.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2026-01-16 12:12:41 -08:00
parent 535da79d62
commit 89fdef17e6
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -388,6 +388,7 @@ func parseSource(input string) (*pb.SourceOp, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed to parse image source reference")
}
ref = reference.TagNameOnly(ref)
return &pb.SourceOp{Identifier: "docker-image://" + ref.String()}, nil
}
if strings.HasPrefix(input, "git://") {