Skip to content
Open
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
5 changes: 1 addition & 4 deletions cmd/keel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ const (
EnvKubernetesContext = "KUBERNETES_CONTEXT"
)

// EnvDebug - set to 1 or anything else to enable debug logging
const EnvDebug = "DEBUG"

func main() {
ver := version.GetKeelVersion()

Expand All @@ -107,7 +104,7 @@ func main() {
"arch": ver.Arch,
}).Info("keel starting...")

if os.Getenv(EnvDebug) == "true" {
if os.Getenv(constants.EnvDebug) == "true" {
log.SetLevel(log.DebugLevel)
}

Expand Down
3 changes: 3 additions & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const (
EnvMailSmtpPort = "MAIL_SMTP_PORT"
EnvMailSmtpUser = "MAIL_SMTP_USER"
EnvMailSmtpPass = "MAIL_SMTP_PASS"

// EnvDebug - set to 1 or anything else to enable debug logging
EnvDebug = "DEBUG"
)

// EnvNotificationLevel - minimum level for notifications, defaults to info
Expand Down
11 changes: 9 additions & 2 deletions extension/notification/teams/teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ func (s *sender) Configure(config *notification.Config) (bool, error) {
Timeout: timeout,
}

webhookLog := s.endpoint
if os.Getenv(constants.EnvDebug) != "true" {
if u, err := url.Parse(s.endpoint); err == nil {
webhookLog = u.Scheme + "://" + u.Host
}
}
log.WithFields(log.Fields{
"name": "teams",
"webhook": s.endpoint,
"name": "teams",
"webhook": webhookLog,
}).Info("extension.notification.teams: sender configured")

return true, nil
Expand Down Expand Up @@ -140,3 +146,4 @@ func (s *sender) Send(event types.EventNotification) error {

return nil
}

Loading