Skip to content

Commit

Permalink
return err if the spec area is nil after unmashal for tfjob v1alpha2 (k…
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxuanzhou authored and Penghui Yan committed Jun 18, 2018
1 parent 2a03aca commit 15a4ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller.v2/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func tfJobFromUnstructured(obj interface{}) (*tfv1alpha2.TFJob, error) {
}
var tfjob tfv1alpha2.TFJob
err := runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, &tfjob)
if err != nil {
if err != nil || tfjob.Spec.TFReplicaSpecs == nil {
return &tfjob, errFailedMarshal
}
return &tfjob, nil
Expand Down

0 comments on commit 15a4ab6

Please sign in to comment.