Преглед на файлове

Update CloudCost service categorization. GuardDuty should not be
classified as "Compute", but instead as "Other".

Signed-off-by: thomasvn <thomasnguyen96@gmail.com>

thomasvn преди 2 години
родител
ревизия
d537f4b517
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      pkg/cloud/aws/athenaquerier.go

+ 4 - 0
pkg/cloud/aws/athenaquerier.go

@@ -208,6 +208,10 @@ func SelectAWSCategory(providerID, usageType, service string) string {
 	// The node and volume conditions are mutually exclusive.
 	// Provider ID has prefix "i-"
 	if strings.HasPrefix(providerID, "i-") {
+		// GuardDuty has a ProviderID prefix of "i-", but should not be categorized as compute
+		if strings.ToUpper(service) == "AMAZONGUARDDUTY" {
+			return opencost.OtherCategory
+		}
 		return opencost.ComputeCategory
 	}
 	// Provider ID has prefix "vol-"