Skip to content

Commit

Permalink
fix: remove telemetry config (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
varnastadeus authored Nov 16, 2021
1 parent 53bacd7 commit da260fb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Log struct {
type API struct {
Key string
URL string
TelemetryURL string
}

var cfg *Config
Expand All @@ -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")
Expand All @@ -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")
}
Expand Down
2 changes: 0 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit da260fb

Please sign in to comment.