We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c163bf7 commit c496a81Copy full SHA for c496a81
app/cli/cmd/attestation_add.go
@@ -119,9 +119,22 @@ func newAttestationAddCmd() *cobra.Command {
119
return err
120
}
121
122
- return output.EncodeOutput(flagOutputFormat, resp, func(s *action.AttestationStatusMaterial) error {
+ if err := output.EncodeOutput(flagOutputFormat, resp, func(s *action.AttestationStatusMaterial) error {
123
return displayMaterialInfo(s, policies[resp.Name])
124
- })
+ }); err != nil {
125
+ return err
126
+ }
127
+
128
+ // Check for gated policy violations
129
+ for _, evaluations := range policies {
130
+ for _, eval := range evaluations {
131
+ if len(eval.Violations) > 0 && eval.Gate {
132
+ return NewGateError(eval.Name)
133
134
135
136
137
+ return nil
138
},
139
)
140
0 commit comments