소스 검색

appropriate error message on slack when we have some context

Mohammed Nafees 4 년 전
부모
커밋
05faedf8ac
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      api/server/handlers/kube_events/create.go

+ 2 - 4
api/server/handlers/kube_events/create.go

@@ -115,9 +115,7 @@ func mapKubeEventToMessage(event *types.CreateKubeEventRequest) string {
 				strings.Split(strings.SplitAfter(event.Message, "exec: ")[1], ": unknown")[0])
 		}
 	} else if strings.HasSuffix(event.Reason, "ImagePullBackOff") {
-		return ""
-	} else if strings.HasSuffix(event.Reason, "CrashLoopBackOff") {
-		return ""
+		return "Deployment error: The application image could not be pulled from the registry"
 	}
 
 	return event.Message
@@ -248,7 +246,7 @@ func notifyPodCrashing(
 			ClusterName: cluster.Name,
 			Name:        event.OwnerName,
 			Namespace:   event.Namespace,
-			Info:        fmt.Sprintf("%s:%s", event.Reason, event.Message),
+			Info:        mapKubeEventToMessage(event),
 			URL: fmt.Sprintf(
 				"%s/applications/%s/%s/%s?project_id=%d",
 				config.ServerConf.ServerURL,