Skip to content

Commit

Permalink
Use ErrorList for experiment validator (kubeflow#2329)
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 authored and shashank-iitbhu committed Jun 30, 2024
1 parent 55de8c4 commit cb096ed
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 cb096ed

Please sign in to comment.