Quellcode durchsuchen

Renamed env variables to CLOUD_COST_CONFIG_PATH

Signed-off-by: Matt Ray <github@mattray.dev>
Matt Ray vor 2 Jahren
Ursprung
Commit
8f8f328aa4
2 geänderte Dateien mit 15 neuen und 15 gelöschten Zeilen
  1. 8 8
      pkg/env/costmodelenv.go
  2. 7 7
      pkg/env/costmodelenv_test.go

+ 8 - 8
pkg/env/costmodelenv.go

@@ -114,9 +114,9 @@ const (
 
 	DataRetentionDailyResolutionDaysEnvVar = "DATA_RETENTION_DAILY_RESOLUTION_DAYS"
 
-	CloudCostEnabledEnvVar          = "CLOUD_COST_ENABLED"
 	KubernetesEnabledEnvVar         = "KUBERNETES_ENABLED"
-	CloudIntegrationSecretPath      = "CLOUD_INTEGRATION_SECRET_PATH"
+	CloudCostEnabledEnvVar          = "CLOUD_COST_ENABLED"
+	CloudCostConfigPath             = "CLOUD_COST_CONFIG_PATH"
 	CloudCostMonthToDateIntervalVar = "CLOUD_COST_MONTH_TO_DATE_INTERVAL"
 	CloudCostRefreshRateHoursEnvVar = "CLOUD_COST_REFRESH_RATE_HOURS"
 	CloudCostQueryWindowDaysEnvVar  = "CLOUD_COST_QUERY_WINDOW_DAYS"
@@ -637,16 +637,16 @@ func GetDataRetentionDailyResolutionDays() int64 {
 	return GetInt64(DataRetentionDailyResolutionDaysEnvVar, 15)
 }
 
-func IsCloudCostEnabled() bool {
-	return GetBool(CloudCostEnabledEnvVar, false)
-}
-
 func IsKubernetesEnabled() bool {
 	return GetBool(KubernetesEnabledEnvVar, true)
 }
 
-func GetCloudIntegrationSecretPath() string {
-	return Get(CloudIntegrationSecretPath, "cloud-integration.json")
+func IsCloudCostEnabled() bool {
+	return GetBool(CloudCostEnabledEnvVar, false)
+}
+
+func GetCloudCostConfigPath() string {
+	return Get(CloudCostConfigPath, "cloud-integration.json")
 }
 
 func GetCloudCostMonthToDateInterval() int {

+ 7 - 7
pkg/env/costmodelenv_test.go

@@ -162,7 +162,7 @@ func TestGetKubernetesEnabled(t *testing.T) {
 
 }
 
-func TestGetCloudIntegrationSecretPath(t *testing.T) {
+func TestGetCloudCostConfigPath(t *testing.T) {
 	tests := []struct {
 		name string
 		want string
@@ -173,17 +173,17 @@ func TestGetCloudIntegrationSecretPath(t *testing.T) {
 			want: "cloud-integration.json",
 		},
 		{
-			name: "Ensure the value is 'cloud-integration.json' when CLOUD_INTEGRATION_SECRET_PATH is set to ''",
+			name: "Ensure the value is 'cloud-integration.json' when CLOUD_COST_CONFIG_PATH is set to ''",
 			want: "cloud-integration.json",
 			pre: func() {
-				os.Setenv("CLOUD_INTEGRATION_SECRET_PATH", "")
+				os.Setenv("CLOUD_COST_CONFIG_PATH", "")
 			},
 		},
 		{
-			name: "Ensure the value is 'flying-pig.json' when CLOUD_INTEGRATION_SECRET_PATH is set to 'flying-pig.json'",
+			name: "Ensure the value is 'flying-pig.json' when CLOUD_COST_CONFIG_PATH is set to 'flying-pig.json'",
 			want: "flying-pig.json",
 			pre: func() {
-				os.Setenv("CLOUD_INTEGRATION_SECRET_PATH", "flying-pig.json")
+				os.Setenv("CLOUD_COST_CONFIG_PATH", "flying-pig.json")
 			},
 		},
 	}
@@ -192,8 +192,8 @@ func TestGetCloudIntegrationSecretPath(t *testing.T) {
 			tt.pre()
 		}
 		t.Run(tt.name, func(t *testing.T) {
-			if got := GetCloudIntegrationSecretPath(); got != tt.want {
-				t.Errorf("GetCloudIntegrationSecretPath() = %v, want %v", got, tt.want)
+			if got := GetCloudCostConfigPath(); got != tt.want {
+				t.Errorf("GetCloudCostConfigPath() = %v, want %v", got, tt.want)
 			}
 		})
 	}