@@ -60,10 +60,10 @@ func (c *Controller) buildDeploymentStatus(ctx context.Context, replicaset *apps
|
60 | 60 | MemoryMib: 0, |
61 | 61 | Status: ctrlv1.ReportDeploymentStatusRequest_Update_Instance_STATUS_UNSPECIFIED, |
62 | 62 | } |
63 | | -if pod.Spec.Resources != nil { |
64 | | -if pod.Spec.Resources.Limits != nil { |
65 | | -instance.CpuMillicores = pod.Spec.Resources.Limits.Cpu().MilliValue() |
66 | | -instance.MemoryMib = pod.Spec.Resources.Limits.Memory().Value() / (1024 * 1024) |
| 63 | +if containers := pod.Spec.Containers; len(containers) > 0 { |
| 64 | +if limits := containers[0].Resources.Limits; limits != nil { |
| 65 | +instance.CpuMillicores = limits.Cpu().MilliValue() |
| 66 | +instance.MemoryMib = limits.Memory().Value() / (1024 * 1024) |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
|