Просмотр исходного кода

add case where no jobs were run

Anukul Sangwan 4 лет назад
Родитель
Сommit
3f10092173

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/chart/Chart.tsx

@@ -159,7 +159,7 @@ const Chart: React.FunctionComponent<Props> = ({
       </BottomWrapper>
 
       <TopRightContainer>
-        {isJob && jobStatus && (
+        {isJob && jobStatus?.status && (
           <>
             <JobStatus status={jobStatus.status}>
               Last run {jobStatus.status.toUpperCase()} at{" "}

+ 3 - 5
server/api/release_handler.go

@@ -602,8 +602,8 @@ func (app *App) HandleGetReleaseAllPods(w http.ResponseWriter, r *http.Request)
 }
 
 type GetJobStatusResult struct {
-	Status    string       `json:"status"`
-	StartTime *metav1.Time `json:"start_time"`
+	Status    string       `json:"status,omitempty"`
+	StartTime *metav1.Time `json:"start_time,omitempty"`
 }
 
 // HandleGetJobStatus gets the status for a specific job
@@ -693,9 +693,7 @@ func (app *App) HandleGetJobStatus(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	res := &GetJobStatusResult{
-		Status: "succeeded",
-	}
+	res := &GetJobStatusResult{}
 
 	// get the most recent job
 	if len(jobs) > 0 {