Skip to content

Commit

Permalink
fix nil dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvegamyhre committed Mar 20, 2024
1 parent 56b7fb7 commit 7ce7043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/jobset/v1alpha2/jobset_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ func (js *JobSet) ValidateCreate() (admission.Warnings, error) {
}

// Validate Job template spec.
var u *unstructured.Unstructured
if err := convertObj2Unstructured(rjob.Template, u); err != nil {
var u unstructured.Unstructured
if err := convertObj2Unstructured(rjob.Template, &u); err != nil {
return nil, fmt.Errorf("error converting to unstructured: %v", err)
}
if err := v.Validate(u); err != nil {
if err := v.Validate(&u); err != nil {
allErrs = append(allErrs, err)
}

Expand Down

0 comments on commit 7ce7043

Please sign in to comment.