Ver código fonte

Update the installInfo endpoint to query the `pod.Spec` instead of (#2663) (#2667)

Thomas Nguyen 2 anos atrás
pai
commit
118a39c04f
1 arquivos alterados com 1 adições e 7 exclusões
  1. 1 7
      pkg/costmodel/router.go

+ 1 - 7
pkg/costmodel/router.go

@@ -1204,9 +1204,6 @@ type InstallInfo struct {
 type ContainerInfo struct {
 	ContainerName string `json:"containerName"`
 	Image         string `json:"image"`
-	ImageID       string `json:"imageID"`
-	StartTime     string `json:"startTime"`
-	Restarts      int32  `json:"restarts"`
 }
 
 func (a *Accesses) GetInstallInfo(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@@ -1232,13 +1229,10 @@ func (a *Accesses) GetInstallInfo(w http.ResponseWriter, r *http.Request, _ http
 	// chart or more likely we are running locally - in either case Images field will return as null
 	if len(pods.Items) > 0 {
 		for _, pod := range pods.Items {
-			for _, container := range pod.Status.ContainerStatuses {
+			for _, container := range pod.Spec.Containers {
 				c := ContainerInfo{
 					ContainerName: container.Name,
 					Image:         container.Image,
-					ImageID:       container.ImageID,
-					StartTime:     pod.Status.StartTime.String(),
-					Restarts:      container.RestartCount,
 				}
 				info.Containers = append(info.Containers, c)
 			}