Skip to content

Commit 838724c

Browse files
committed
fail att add when gated policy contains violations
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent c163bf7 commit 838724c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎app/cli/cmd/attestation_add.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ func newAttestationAddCmd() *cobra.Command {
119119
return err
120120
}
121121

122+
// Check for gated policy violations
123+
for _, evaluations := range policies {
124+
for _, eval := range evaluations {
125+
if len(eval.Violations) > 0 && eval.Gate {
126+
return NewGateError(eval.Name)
127+
}
128+
}
129+
}
130+
122131
return output.EncodeOutput(flagOutputFormat, resp, func(s *action.AttestationStatusMaterial) error {
123132
return displayMaterialInfo(s, policies[resp.Name])
124133
})

0 commit comments

Comments
 (0)