Explorar o código

Merge pull request #188 from kubecost/AjayTripathy-override-podlabels

Ajay tripathy override podlabels
Ajay Tripathy %!s(int64=6) %!d(string=hai) anos
pai
achega
fe3a03e6f8
Modificáronse 1 ficheiros con 3 adicións e 9 borrados
  1. 3 9
      costmodel/costmodel.go

+ 3 - 9
costmodel/costmodel.go

@@ -456,9 +456,7 @@ func (cm *CostModel) ComputeCostData(cli prometheusClient.Client, clientset kube
 			}
 
 			for k, v := range nsLabels {
-				if _, ok := podLabels[k]; !ok {
-					podLabels[k] = v
-				}
+				podLabels[k] = v
 			}
 
 			nodeName := pod.Spec.NodeName
@@ -681,9 +679,7 @@ func findDeletedPodInfo(cli prometheusClient.Client, missingContainers map[strin
 				labels = make(map[string]string)
 			}
 			for k, v := range costData.NamespaceLabels {
-				if _, ok := labels[k]; !ok {
-					labels[k] = v
-				}
+				labels[k] = v
 			}
 			costData.Labels = labels
 		}
@@ -1404,9 +1400,7 @@ func (cm *CostModel) ComputeCostDataRange(cli prometheusClient.Client, clientset
 			}
 
 			for k, v := range nsLabels {
-				if _, ok := podLabels[k]; !ok {
-					podLabels[k] = v
-				}
+				podLabels[k] = v
 			}
 
 			for i, container := range pod.Spec.Containers {