Skip to content

Commit 6b27fd6

Browse files
prachirpfrankfarzan
authored andcommitted
Log violated constraint
1 parent e9d4386 commit 6b27fd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

go/pkg/functions/gatekeeper/validate.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ func parseResults(results []*opatypes.Result) error {
155155
if !found {
156156
path = "?"
157157
}
158-
msgs = append(msgs, fmt.Sprintf("%s\n\nname: %q\npath: %s", r.Msg, name, path))
158+
constraintName := r.Constraint.GetName()
159+
msgs = append(msgs, fmt.Sprintf("%s\n\nname: %q\npath: %s\nviolatedConstraint: %s", r.Msg, name, path, constraintName))
159160
}
160161

161162
sort.Strings(msgs)

0 commit comments

Comments
 (0)