Skip to content

Commit

Permalink
Removed the summary of violations at the end since we are printing th…
Browse files Browse the repository at this point in the history
…em as they occur
  • Loading branch information
tbarnes94 committed Mar 13, 2024
1 parent 2c3b3c9 commit a70149a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/safeguards/safeguards.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,24 @@ func ValidateManifests(ctx context.Context, manifestFiles []string) error {

var violations []string
for _, m := range manifestFiles {
var tempViolations []string
manifests, err := fc.ReadManifests(m)
if err != nil {
log.Errorf("reading manifests %s", err.Error())
return err
}

// validation of deployment manifest with constraints, templates loaded
violations, err = validateManifests(ctx, c, manifests)
tempViolations, err = validateManifests(ctx, c, manifests)
if err != nil {
log.Errorf("validating manifests: %s", err.Error())
return err
}
violations = append(violations, tempViolations...)
}

// returning the full list of violations after each manifest is checked
if len(violations) > 0 {
log.Printf("violations have occurred: %s", violations)
} else {
if len(violations) == 0 {
log.Printf("No violations found.")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/safeguards/safeguards_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func validateManifests(ctx context.Context, c *constraintclient.Client, manifest
}
}
}
log.Printf("\n")
fmt.Println("\n")

Check failure on line 183 in pkg/safeguards/safeguards_helpers.go

View workflow job for this annotation

GitHub Actions / build

fmt.Println arg list ends with redundant newline
}

return violations, nil
Expand Down

0 comments on commit a70149a

Please sign in to comment.