(req *policysession.CheckPolicyRequest)
| 501 | } |
| 502 | |
| 503 | func platformFromReq(req *policysession.CheckPolicyRequest) (*ocispecs.Platform, error) { |
| 504 | if req.Platform != nil { |
| 505 | platformStr := req.Platform.OS + "/" + req.Platform.Architecture |
| 506 | if req.Platform.Variant != "" { |
| 507 | platformStr += "/" + req.Platform.Variant |
| 508 | } |
| 509 | pl, err := platforms.Parse(platformStr) |
| 510 | if err != nil { |
| 511 | return nil, errors.Wrapf(err, "failed to parse platform") |
| 512 | } |
| 513 | pl = platforms.Normalize(pl) |
| 514 | return &pl, nil |
| 515 | } |
| 516 | return nil, nil |
| 517 | } |
| 518 | |
| 519 | func sourceName(req *policysession.CheckPolicyRequest) string { |
| 520 | name := req.Source.Source.Identifier |
no test coverage detected
searching dependent graphs…