Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-505 opt-out #243

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package config

import (
"os"

"github.com/kelseyhightower/envconfig"
)

Expand All @@ -41,17 +39,16 @@ type EverestConfig struct {
TelemetryURL string `envconfig:"TELEMETRY_URL"`
// TelemetryInterval Everest telemetry sending frequency.
TelemetryInterval string `envconfig:"TELEMETRY_INTERVAL"`
// DisableTelemetry disable Everest and the upstream operators telemetry
DisableTelemetry bool `default:"false" envconfig:"DISABLE_TELEMETRY"`
gen1us2k marked this conversation as resolved.
Show resolved Hide resolved
}

// ParseConfig parses env vars and fills EverestConfig.
func ParseConfig() (*EverestConfig, error) {
c := &EverestConfig{}
err := envconfig.Process("", c)
if c.TelemetryURL == "" {
// checking opt-out - if the env variable does not even exist, set the default URL
if _, ok := os.LookupEnv("TELEMETRY_URL"); !ok {
c.TelemetryURL = TelemetryURL
}
c.TelemetryURL = TelemetryURL
}
if c.TelemetryInterval == "" {
c.TelemetryInterval = TelemetryInterval
Expand Down
Loading