Skip to content

Commit

Permalink
Don't blank out object on failed status update
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Oct 2, 2020
1 parent a92d8cd commit 9465df8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controller-gen/generators/type_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,13 @@ func (a *{{.lowerName}}StatusHandler) sync(key string, obj *{{.version}}.{{.type
var newErr error
obj.Status = newStatus
obj, newErr = a.client.UpdateStatus(obj)
newObj, newErr := a.client.UpdateStatus(obj)
if err == nil {
err = newErr
}
if newErr == nil {
obj = newObj
}
}
return obj, err
}
Expand Down

0 comments on commit 9465df8

Please sign in to comment.