Skip to content

Commit

Permalink
fix: set pass to false if errors in policies
Browse files Browse the repository at this point in the history
There is a pass var that is always set to true but never set to false
when there are errors in the policies.  This sets that var to false upon
errors.

Signed-off-by: Peter Ng <[email protected]>
  • Loading branch information
Peter Ng authored and andrewrynhard committed Aug 7, 2019
1 parent 19dd2b8 commit 365c592
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/enforcer/enforcer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (c *Conform) Enforce(setters ...policy.Option) {
if err := c.summarizer.SetStatus("failure", p.Type, check.Name(), check.Message()); err != nil {
log.Printf("WARNING: summary failed: %+v", err)
}
pass = false
} else {
fmt.Fprintf(w, "%s\t%s\t%s\t%s\t\n", p.Type, check.Name(), "PASS", "<none>")
if err := c.summarizer.SetStatus("success", p.Type, check.Name(), check.Message()); err != nil {
Expand Down

0 comments on commit 365c592

Please sign in to comment.