Browse Source

Merge pull request #351 from kubecost/AjayTripathy-fix-unfulfilled

don't immediately return for unfulfilled PVs
Ajay Tripathy 6 years ago
parent
commit
5d640b80b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pkg/costmodel/promparsers.go

+ 2 - 1
pkg/costmodel/promparsers.go

@@ -247,7 +247,8 @@ func GetPVAllocationMetrics(queryResult interface{}, defaultClusterID string) (m
 
 		pvName, err := val.GetString("persistentvolume")
 		if err != nil {
-			return toReturn, err
+			klog.Infof("persistentvolume field does not exist for pv %s", pvcName) // This is possible for an unfulfilled claim
+			continue
 		}
 
 		key := fmt.Sprintf("%s,%s,%s", ns, pod, clusterID)