Skip to content

Commit

Permalink
add in format string for warning (sigstore#2699)
Browse files Browse the repository at this point in the history
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
  • Loading branch information
priyawadhwa authored and dmitris committed Mar 24, 2023
1 parent 5602453 commit 6aedb43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cosign/rego/rego.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func evaluateRegoEvalMapResult(query string, response []interface{}) (warning er

// Check if it is complaint
if resultObject.Result {
return fmt.Errorf(resultObject.Warning), nil
if resultObject.Warning == "" {
return nil, nil
}
return fmt.Errorf("warning: %s", resultObject.Warning), nil
}
warning = errors.New(resultObject.Warning)
error = fmt.Errorf("policy is not compliant for query '%s' with errors: %s", query, resultObject.Error)
Expand Down

0 comments on commit 6aedb43

Please sign in to comment.