mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
Fix: Error cause is missing (#7563)
Include the message of an error happening during mutation of elements of a `foreach` loop. Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
a21c5fb347
commit
0344f52d6f
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ package mutation
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
|
@ -36,7 +37,7 @@ func (f *forEachMutator) mutateForEach(ctx context.Context) *mutate.Response {
|
|||
|
||||
mutateResp := f.mutateElements(ctx, foreach, elements)
|
||||
if mutateResp.Status == engineapi.RuleStatusError {
|
||||
return mutate.NewErrorResponse("failed to mutate elements", err)
|
||||
return mutate.NewErrorResponse("failed to mutate elements", errors.New(mutateResp.Message))
|
||||
}
|
||||
|
||||
if mutateResp.Status != engineapi.RuleStatusSkip {
|
||||
|
|
Loading…
Add table
Reference in a new issue