Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unnecessary env var using opsgenie team api-key #454

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions common/client/alert/opsgenie.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ type AlertConfig struct {
P2PNetwork string
ApiKey string
Enabled bool
Responder []Responder
VisibleTo []Responder
}

// OpsgenieClient is the alert client.
Expand Down
32 changes: 0 additions & 32 deletions fly/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ func GetAlertConfig() (alert.AlertConfig, error) {
P2PNetwork: p2pNetwork.Enviroment,
Enabled: getAlertEnabled(),
ApiKey: getAlertApiKey(),
Responder: getAlertResponder(),
VisibleTo: getAlertVisibleTo(),
}, nil
}

Expand All @@ -107,33 +105,3 @@ func getAlertEnabled() bool {
func getAlertApiKey() string {
return os.Getenv("ALERT_API_KEY")
}

// getAlertResponder get alert responder.
func getAlertResponder() []alert.Responder {
responderID := os.Getenv("ALERT_RESPONDER_ID")
responderType := os.Getenv("ALERT_RESPONDER_TYPE")
responderName := os.Getenv("ALERT_RESPONDER_NAME")
responderUsername := os.Getenv("ALERT_RESPONDER_USERNAME")
responder := alert.Responder{
Id: responderID,
Type: responderType,
Name: responderName,
Username: responderUsername,
}
return []alert.Responder{responder}
}

// getAlertVisibleTo get alert visibleTo.
func getAlertVisibleTo() []alert.Responder {
visibleToID := os.Getenv("ALERT_VISIBLETO_ID")
visibleToType := os.Getenv("ALERT_VISIBLETO_TYPE")
visibleToName := os.Getenv("ALERT_VISIBLETO_NAME")
visibleToUsername := os.Getenv("ALERT_VISIBLETO_USERNAME")
visibleTo := alert.Responder{
Id: visibleToID,
Type: visibleToType,
Name: visibleToName,
Username: visibleToUsername,
}
return []alert.Responder{visibleTo}
}
2 changes: 0 additions & 2 deletions fly/internal/alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ func LoadAlerts(cfg alert.AlertConfig) map[string]alert.Alert {
Tags: []string{cfg.Enviroment, cfg.P2PNetwork, "fly", "vaa", "mongo"},
Entity: "fly",
Priority: alert.CRITICAL,
Responder: cfg.Responder,
VisibleTo: cfg.VisibleTo,
}
return alerts
}