Sfoglia il codice sorgente

Merge pull request #2340 from meehawk/fix/failed-pods-deletion

fix: failed pods deletion + include metadata in tooltip for failed pods
Porter Support 3 anni fa
parent
commit
bfa4c6f4aa

+ 4 - 2
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/ControllerTab.tsx

@@ -28,6 +28,7 @@ export type ControllerTabPodType = {
   restartCount: number | string;
   podAge: string;
   revisionNumber?: number;
+  containerStatus: any;
 };
 
 const formatCreationTimestamp = timeFormat("%H:%M:%S %b %d, '%y");
@@ -125,6 +126,7 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
             status: pod?.status,
             replicaSetName,
             restartCount,
+            containerStatus,
             podAge: pod?.metadata?.creationTimestamp ? podAge : "N/A",
             revisionNumber:
               (pod?.metadata?.annotations &&
@@ -233,8 +235,8 @@ const ControllerTabFC: React.FunctionComponent<Props> = ({
         {},
         {
           cluster_id: currentCluster.id,
-          name: pod.metadata?.name,
-          namespace: pod.metadata?.namespace,
+          name: pod?.name,
+          namespace: pod?.namespace,
           id: currentProject.id,
         }
       )

+ 13 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/PodRow.tsx

@@ -43,6 +43,12 @@ const PodRow: React.FunctionComponent<PodRowProps> = ({
           {pod?.name}
           <Grey>Restart count: {pod.restartCount}</Grey>
           <Grey>Created on: {pod.podAge}</Grey>
+          {podStatus === "failed" ? (
+            <FailedStatusContainer>
+              <Grey>Failure Reason: {pod?.containerStatus?.state?.waiting?.reason}</Grey>
+              <Grey>{pod?.containerStatus?.state?.waiting?.message}</Grey>
+            </FailedStatusContainer>
+          ) : null}
         </Tooltip>
       )}
 
@@ -73,6 +79,13 @@ const Grey = styled.div`
   color: #aaaabb;
 `;
 
+const FailedStatusContainer = styled.div`
+  width: 100%;
+  border: 1px solid hsl(0deg, 100%, 30%);
+  padding: 5px;
+  margin-block: 5px;
+`;
+
 const Tooltip = styled.div`
   position: absolute;
   left: 35px;