AjayTripathy 6 лет назад
Родитель
Сommit
0cd7790c65
4 измененных файлов с 5 добавлено и 3 удалено
  1. 1 1
      cloud/gcpprovider.go
  2. 1 0
      cloud/provider.go
  3. 1 1
      costmodel/costmodel.go
  4. 2 1
      costmodel/router.go

+ 1 - 1
cloud/gcpprovider.go

@@ -279,7 +279,7 @@ func (gcp *GCP) ClusterInfo() (map[string]string, error) {
 
 	attribute, err := metadataClient.InstanceAttributeValue("cluster-name")
 	if err != nil {
-		return nil, err
+		klog.Infof("Error loading metadata cluster-name: %s", err.Error())
 	}
 
 	c, err := gcp.GetConfig()

+ 1 - 0
cloud/provider.go

@@ -150,6 +150,7 @@ type CustomPricing struct {
 	SharedCosts           map[string]string `json:"sharedCost"`
 	ClusterName           string            `json:"clusterName"`
 	SharedNamespaces      string            `json:"sharedNamespaces"`
+	ReadOnly              string            `json:"readOnly"`
 }
 
 // Provider represents a k8s provider.

+ 1 - 1
costmodel/costmodel.go

@@ -820,7 +820,7 @@ func findDeletedNodeInfo(cli prometheusClient.Client, missingNodes map[string]*c
 		}
 
 		if len(cpuCosts) == 0 {
-			klog.V(1).Infof("Historical data for node prices not available. Ingest this server's /metrics endpoint to get that data.")
+			klog.V(1).Infof("Kubecost prometheus metrics not currently available. Ingest this server's /metrics endpoint to get that data.")
 		}
 
 		for node, costv := range cpuCosts {

+ 2 - 1
costmodel/router.go

@@ -836,8 +836,9 @@ func Initialize() {
 	configs, err := kubeClientset.CoreV1().ConfigMaps(kubecostNamespace).Get("pricing-configs", metav1.GetOptions{})
 	if err != nil {
 		klog.Infof("ERROR FETCHING configmap: %s", err.Error())
+	} else {
+		watchConfigFunc(configs)
 	}
-	watchConfigFunc(configs)
 
 	k8sCache.SetConfigMapUpdateFunc(watchConfigFunc)