Kaynağa Gözat

support nil pvWithCost

AjayTripathy 7 yıl önce
ebeveyn
işleme
c2179ca69c
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      costmodel/costmodel.go

+ 3 - 0
costmodel/costmodel.go

@@ -569,6 +569,9 @@ func GetPVCost(pv *costAnalyzerCloud.PV, kpv *v1.PersistentVolume, cloud costAna
 	if err != nil {
 		return err
 	}
+	if pvWithCost == nil {
+		return nil
+	}
 	pv.Cost = pvWithCost.Cost
 	return err
 }