diff --git a/config/config.go b/config/config.go index 35e75f6..1457706 100644 --- a/config/config.go +++ b/config/config.go @@ -22,7 +22,6 @@ type Log struct { type API struct { Key string URL string - TelemetryURL string } var cfg *Config @@ -37,7 +36,6 @@ func Get() Config { _ = viper.BindEnv("api.key", "API_KEY") _ = viper.BindEnv("api.url", "API_URL") - _ = viper.BindEnv("api.telemetryurl", "API_TELEMETRY_URL") _ = viper.BindEnv("clusterid", "CLUSTER_ID") _ = viper.BindEnv("kubeconfig") @@ -59,9 +57,6 @@ func Get() Config { if cfg.API.URL == "" { required("API_URL") } - if cfg.API.TelemetryURL == "" { - required("API_TELEMETRY_URL") - } if cfg.ClusterID == "" { required("CLUSTER_ID") } diff --git a/config/config_test.go b/config/config_test.go index 82cd4f7..ab2e5d9 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -10,7 +10,6 @@ import ( func TestConfig(t *testing.T) { require.NoError(t, os.Setenv("API_KEY", "abc")) require.NoError(t, os.Setenv("API_URL", "api.cast.ai")) - require.NoError(t, os.Setenv("API_TELEMETRY_URL", "telemetry.cast.ai")) require.NoError(t, os.Setenv("KUBECONFIG", "~/.kube/config")) require.NoError(t, os.Setenv("CLUSTER_ID", "c1")) require.NoError(t, os.Setenv("PPROF_PORT", "6060")) @@ -19,7 +18,6 @@ func TestConfig(t *testing.T) { require.Equal(t, "abc", cfg.API.Key) require.Equal(t, "api.cast.ai", cfg.API.URL) - require.Equal(t, "telemetry.cast.ai", cfg.API.TelemetryURL) require.Equal(t, "~/.kube/config", cfg.Kubeconfig) require.Equal(t, "c1", cfg.ClusterID) require.Equal(t, 6060, cfg.PprofPort) diff --git a/main.go b/main.go index 2758cf4..17c5c74 100644 --- a/main.go +++ b/main.go @@ -34,7 +34,7 @@ func main() { logLevel := logrus.Level(cfg.Log.Level) logger.SetLevel(logrus.Level(cfg.Log.Level)) - telemetryClient := telemetry.NewClient(logger, telemetry.NewDefaultClient(cfg.API.TelemetryURL, cfg.API.Key, logLevel)) + telemetryClient := telemetry.NewClient(logger, telemetry.NewDefaultClient(cfg.API.URL, cfg.API.Key, logLevel)) log := logrus.WithFields(logrus.Fields{}) if err := run(signals.SetupSignalHandler(), telemetryClient, logger, cfg); err != nil {