|
@@ -4,7 +4,6 @@ import (
|
|
|
"context"
|
|
"context"
|
|
|
"flag"
|
|
"flag"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
- "github.com/kubecost/cost-model/pkg/util/timeutil"
|
|
|
|
|
"net/http"
|
|
"net/http"
|
|
|
"reflect"
|
|
"reflect"
|
|
|
"strconv"
|
|
"strconv"
|
|
@@ -12,6 +11,8 @@ import (
|
|
|
"sync"
|
|
"sync"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
|
|
+ "github.com/kubecost/cost-model/pkg/util/timeutil"
|
|
|
|
|
+
|
|
|
"k8s.io/klog"
|
|
"k8s.io/klog"
|
|
|
|
|
|
|
|
"github.com/julienschmidt/httprouter"
|
|
"github.com/julienschmidt/httprouter"
|
|
@@ -401,7 +402,6 @@ func (a *Accesses) ClusterCosts(w http.ResponseWriter, r *http.Request, ps httpr
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
useThanos, _ := strconv.ParseBool(r.URL.Query().Get("multi"))
|
|
useThanos, _ := strconv.ParseBool(r.URL.Query().Get("multi"))
|
|
|
|
|
|
|
|
if useThanos && !thanos.IsEnabled() {
|
|
if useThanos && !thanos.IsEnabled() {
|
|
@@ -896,7 +896,7 @@ func Initialize(additionalConfigWatchers ...ConfigWatchers) *Accesses {
|
|
|
|
|
|
|
|
watchConfigFunc := func(c interface{}) {
|
|
watchConfigFunc := func(c interface{}) {
|
|
|
conf := c.(*v1.ConfigMap)
|
|
conf := c.(*v1.ConfigMap)
|
|
|
- if conf.GetName() == "pricing-configs" {
|
|
|
|
|
|
|
+ if conf.GetName() == env.GetPricingConfigmapName() {
|
|
|
_, err := cloudProvider.UpdateConfigFromConfigMap(conf.Data)
|
|
_, err := cloudProvider.UpdateConfigFromConfigMap(conf.Data)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
klog.Infof("ERROR UPDATING %s CONFIG: %s", "pricing-configs", err.Error())
|
|
klog.Infof("ERROR UPDATING %s CONFIG: %s", "pricing-configs", err.Error())
|
|
@@ -926,6 +926,7 @@ func Initialize(additionalConfigWatchers ...ConfigWatchers) *Accesses {
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
klog.Infof("No %s configmap found at installtime, using existing configs: %s", cw.ConfigmapName, err.Error())
|
|
klog.Infof("No %s configmap found at installtime, using existing configs: %s", cw.ConfigmapName, err.Error())
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ klog.Infof("Found configmap %s, watching...", configs.Name)
|
|
|
watchConfigFunc(configs)
|
|
watchConfigFunc(configs)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|