Ver Fonte

fix hardcoded namespace

AjayTripathy há 6 anos atrás
pai
commit
cf295416ca
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      costmodel/router.go

+ 2 - 1
costmodel/router.go

@@ -832,8 +832,9 @@ func Initialize() {
 			}
 		}
 	}
+	kubecostNamespace := os.Getenv("KUBECOST_NAMESPACE")
 	// We need an initial invocation because the init of the cache has happened before we had access to the provider.
-	configs, err := kubeClientset.CoreV1().ConfigMaps("kubecost").Get("pricing-configs", metav1.GetOptions{})
+	configs, err := kubeClientset.CoreV1().ConfigMaps(kubecostNamespace).Get("pricing-configs", metav1.GetOptions{})
 	if err != nil {
 		klog.Infof("ERROR FETCHING configmap: %s", err.Error())
 	}