Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.
15 changes: 15 additions & 0 deletions controllers/run_controller_databricks.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,22 @@ func (r *RunReconciler) submit(instance *databricksv1alpha1.Run) (bool, error) {
return false, err
}

// update the run state now, in case the RunsGetOutput call below fails
var pendingState dbmodels.RunLifeCycleState = dbmodels.RunLifeCycleStatePending
run.State = &dbmodels.RunState{
LifeCycleState: &pendingState,
}
instance.Status = &azure.JobsRunsGetOutputResponse{
Metadata: *run,
}

err = r.Update(context.Background(), instance)
if err != nil {
return false, err
}

runOutput, err := r.getRunOutput(run.RunID)

if err != nil {
return false, err
}
Expand Down