Răsfoiți Sursa

Remove log, update comments

Sean Holcomb 5 ani în urmă
părinte
comite
0ea67627c1
3 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 0 1
      pkg/cloud/awsprovider.go
  2. 2 2
      pkg/costmodel/cluster.go
  3. 1 0
      pkg/costmodel/costmodel.go

+ 0 - 1
pkg/cloud/awsprovider.go

@@ -2286,6 +2286,5 @@ func (aws *AWS) ParseLBID(id string) string {
 		}
 		return id
 	}
-	log.Infof("awsprovider.ParseLBID: successful parse %s, %v", match[1], match)
 	return match[1]
 }

+ 2 - 2
pkg/costmodel/cluster.go

@@ -621,8 +621,6 @@ func ClusterLoadBalancers(cp cloud.Provider, client prometheus.Client, duration,
 		if err != nil {
 			log.Warningf("ClusterLoadBalancers: LB cost data missing ingress_ip")
 			providerID = ""
-		} else {
-			providerID = cp.ParseLBID(providerID)
 		}
 		lbCost := result.Values[0].Value
 
@@ -635,6 +633,8 @@ func ClusterLoadBalancers(cp cloud.Provider, client prometheus.Client, duration,
 				ProviderID: cp.ParseLBID(providerID),
 			}
 		}
+		// Fill in Provider ID if it is available and missing in the loadBalancerMap
+		// Prevents there from being a duplicate LoadBalancers on the same day
 		if providerID != "" && loadBalancerMap[key].ProviderID == ""{
 			loadBalancerMap[key].ProviderID = providerID
 		}

+ 1 - 0
pkg/costmodel/costmodel.go

@@ -1227,6 +1227,7 @@ func (cm *CostModel) GetLBCost(cp costAnalyzerCloud.Provider) (map[string]*costA
 			newLoadBalancer := *loadBalancer
 			for _, loadBalancerIngress := range service.Status.LoadBalancer.Ingress {
 				address := loadBalancerIngress.IP
+				// Some cloud providers use hostname rather than IP
 				if address == "" {
 					address = loadBalancerIngress.Hostname
 				}