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 <curtis@mail.ustc.edu.cn>
  • Loading branch information
ckcd committed Jun 20, 2024
1 parent f8b8d8d commit 7c19c45
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 7c19c45

Please sign in to comment.