2
0
Эх сурвалжийг харах

Merge branch 'develop' of github.com:kubecost/cost-model into alejandro/accumulate-by-duration

Alejandro 4 жил өмнө
parent
commit
c6f0b06a51

+ 1 - 1
pkg/env/costmodelenv.go

@@ -129,7 +129,7 @@ func GetPricingConfigmapName() string {
 // GetAWSAccessKeyID returns the environment variable value for AWSAccessKeyIDEnvVar which represents
 // GetAWSAccessKeyID returns the environment variable value for AWSAccessKeyIDEnvVar which represents
 // the AWS access key for authentication
 // the AWS access key for authentication
 func GetAppVersion() string {
 func GetAppVersion() string {
-	return Get(AppVersionEnvVar, "1.89.1")
+	return Get(AppVersionEnvVar, "1.90.0-rc.0")
 }
 }
 
 
 // IsEmitNamespaceAnnotationsMetric returns true if cost-model is configured to emit the kube_namespace_annotations metric
 // IsEmitNamespaceAnnotationsMetric returns true if cost-model is configured to emit the kube_namespace_annotations metric

+ 20 - 0
pkg/kubecost/bingen.go

@@ -1,5 +1,25 @@
 package kubecost
 package kubecost
 
 
+////////////////////////////////////////////////////////////////////////////////
+// NOTE: If you add fields to _any_ struct that is serialized by bingen, please
+// make sure to add those fields to the END of the struct definition. This is
+// required for backwards-compatibility. So:
+//
+// type Foo struct {
+//     ExistingField1 string
+//     ExistingField2 int
+// }
+//
+// becomes:
+//
+// type Foo struct {
+//     ExistingField1 string
+//     ExistingField2 int
+//     NewField       float64 // @bingen: <- annotation ref: bingen README
+// }
+//
+////////////////////////////////////////////////////////////////////////////////
+
 // Default Version Set (uses -version flag passed) includes shared resources
 // Default Version Set (uses -version flag passed) includes shared resources
 // @bingen:generate:Window
 // @bingen:generate:Window
 
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 654 - 419
pkg/kubecost/kubecost_codecs.go


+ 6 - 1
pkg/kubecost/summaryallocation.go

@@ -889,7 +889,12 @@ func (sas *SummaryAllocationSet) AggregateBy(aggregateBy []string, options *Allo
 			// Compute sharing coeffs by dividing the thus-far accumulated
 			// Compute sharing coeffs by dividing the thus-far accumulated
 			// numerators by the now-finalized denominator.
 			// numerators by the now-finalized denominator.
 			for key := range sharingCoeffs {
 			for key := range sharingCoeffs {
-				sharingCoeffs[key] /= sharingCoeffDenominator
+				if sharingCoeffs[key] > 0.0 {
+					sharingCoeffs[key] /= sharingCoeffDenominator
+				} else {
+					log.Warningf("SummaryAllocation: detected illegal sharing coefficient for %s: %v (setting to zero)", key, sharingCoeffs[key])
+					sharingCoeffs[key] = 0.0
+				}
 			}
 			}
 
 
 			for key, sa := range resultSet.SummaryAllocations {
 			for key, sa := range resultSet.SummaryAllocations {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 150 - 13416
ui/package-lock.json


+ 1 - 1
ui/package.json

@@ -33,7 +33,7 @@
     "@babel/plugin-proposal-class-properties": "^7.13.0",
     "@babel/plugin-proposal-class-properties": "^7.13.0",
     "@babel/plugin-transform-runtime": "^7.13.10",
     "@babel/plugin-transform-runtime": "^7.13.10",
     "@babel/preset-react": "^7.12.13",
     "@babel/preset-react": "^7.12.13",
-    "parcel": "*",
+    "parcel": "^2.2.1",
     "set-value": "4.0.1"
     "set-value": "4.0.1"
   },
   },
   "resolutions": {
   "resolutions": {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно