Ver código fonte

Merge pull request #538 from kubecost/Ajay-Tripathy-fix-inf

fix INF on unallocated
Ajay Tripathy 5 anos atrás
pai
commit
390bf1452f
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      pkg/costmodel/metrics.go

+ 1 - 1
pkg/costmodel/metrics.go

@@ -525,7 +525,7 @@ func StartCostModelMetricRecording(a *Accesses) bool {
 							if timesClaimed == 0 {
 							if timesClaimed == 0 {
 								timesClaimed = 1 // unallocated PVs are unclaimed but have a full allocation
 								timesClaimed = 1 // unallocated PVs are unclaimed but have a full allocation
 							}
 							}
-							a.PVAllocationRecorder.WithLabelValues(namespace, podName, pvc.Claim, pvc.VolumeName).Set(pvc.Values[0].Value / float64(pvc.TimesClaimed))
+							a.PVAllocationRecorder.WithLabelValues(namespace, podName, pvc.Claim, pvc.VolumeName).Set(pvc.Values[0].Value / float64(timesClaimed))
 							labelKey := getKeyFromLabelStrings(namespace, podName, pvc.Claim, pvc.VolumeName)
 							labelKey := getKeyFromLabelStrings(namespace, podName, pvc.Claim, pvc.VolumeName)
 							pvcSeen[labelKey] = true
 							pvcSeen[labelKey] = true
 						}
 						}