in pkg/plan/track_step.go [64:92]
func stepDetails(log []*models.ClusterPlanStepInfo) *FailureDetails {
if len(log) == 0 {
return nil
}
step := log[len(log)-1]
if *step.StepID != planCompleted || *step.Status != errorStatus {
return nil
}
stepLog := step.InfoLog[len(step.InfoLog)-1]
details := FailureDetails{
FailureType: stepLog.FailureType,
}
if len(stepLog.Details) > 0 {
details.Details = stepLog.Details
}
if stepLog.InternalDetails != nil {
details.Internal = stepLog.InternalDetails
}
if reflect.DeepEqual(details, FailureDetails{}) {
return nil
}
return &details
}