Skip to content

Commit

Permalink
Step analyze fix (#257)
Browse files Browse the repository at this point in the history
* If any matching evidence is found, step should pass
* Remove passed step results if artifacts don't match

---------

Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell authored Jun 11, 2024
1 parent 26d4ac1 commit 946f98e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ func (p Policy) verifyArtifacts(resultsByStep map[string]StepResult) (map[string
}

result.Rejected = append(result.Rejected, reject)
result.Passed = []source.CollectionVerificationResult{}
resultsByStep[step.Name] = result
}
}
Expand Down
2 changes: 1 addition & 1 deletion policy/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type StepResult struct {
// in order to save the failure reasons so we can present them all at the end of the verification process.
func (r StepResult) Analyze() bool {
var pass bool
if len(r.Passed) > 0 && len(r.Rejected) == 0 {
if len(r.Passed) > 0 {
pass = true
}

Expand Down

0 comments on commit 946f98e

Please sign in to comment.