Ver código fonte

Merge pull request #1131 from kubecost/kaelan-ingest-uid

Implement UID id of pods to fix time running inaccuracy
Kaelan Patel 4 anos atrás
pai
commit
bb841a8716
2 arquivos alterados com 485 adições e 184 exclusões
  1. 477 184
      pkg/costmodel/allocation.go
  2. 8 0
      pkg/env/costmodelenv.go

Diferenças do arquivo suprimidas por serem muito extensas
+ 477 - 184
pkg/costmodel/allocation.go


+ 8 - 0
pkg/env/costmodelenv.go

@@ -82,6 +82,8 @@ const (
 	PrometheusRetryOnRateLimitResponseEnvVar    = "PROMETHEUS_RETRY_ON_RATE_LIMIT"
 	PrometheusRetryOnRateLimitMaxRetriesEnvVar  = "PROMETHEUS_RETRY_ON_RATE_LIMIT_MAX_RETRIES"
 	PrometheusRetryOnRateLimitDefaultWaitEnvVar = "PROMETHEUS_RETRY_ON_RATE_LIMIT_DEFAULT_WAIT"
+
+	IngestPodUIDEnvVar = "INGEST_POD_UID"
 )
 
 // GetKubecostConfigBucket returns a file location for a mounted bucket configuration which is used to store
@@ -459,3 +461,9 @@ func LegacyExternalCostsAPIDisabled() bool {
 func GetPromClusterLabel() string {
 	return Get(PromClusterIDLabelEnvVar, "cluster_id")
 }
+
+// IsIngestingPodUID returns the env variable from ingestPodUID, which alters the
+// contents of podKeys in Allocation
+func IsIngestingPodUID() bool {
+	return GetBool(IngestPodUIDEnvVar, false)
+}

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff