Skip to content

Commit

Permalink
Use ErrorList for validator
Browse files Browse the repository at this point in the history
Signed-off-by: Kun Chang <[email protected]>
  • Loading branch information
ckcd committed May 27, 2024
1 parent c4c3eb5 commit 0bf4cbc
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 196 deletions.
3 changes: 2 additions & 1 deletion pkg/webhook/v1beta1/experiment/validation_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func (v *ExperimentValidator) Handle(ctx context.Context, req admission.Request)
return admission.Errored(http.StatusBadRequest, err)
}

err = v.ValidateExperiment(inst, oldInst)
allErrs := v.ValidateExperiment(inst, oldInst)
err = allErrs.ToAggregate()
if err != nil {
return admission.Errored(http.StatusBadRequest, err)
}
Expand Down
Loading

0 comments on commit 0bf4cbc

Please sign in to comment.