Explorar o código

fix panic if labels wrong

AjayTripathy %!s(int64=6) %!d(string=hai) anos
pai
achega
a2bbfbabb4
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      costmodel/costmodel.go

+ 1 - 0
costmodel/costmodel.go

@@ -663,6 +663,7 @@ func findDeletedPodInfo(cli prometheusClient.Client, missingContainers map[strin
 			labels, ok := podLabels[cm.PodName]
 			if !ok {
 				klog.V(1).Infof("Unable to find historical data for pod '%s'", cm.PodName)
+				labels = make(map[string]string)
 			}
 			for k, v := range costData.NamespaceLabels {
 				if _, ok := labels[k]; !ok {