Documentation
¶
Overview ¶
pkg/notification/email.go
Email notification dispatch via SMTP. SMTP credentials are read from pkg/konfig env vars:
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM
Recipients are declared per team in the Katalog notification config. Multiple recipients receive one email each (BCC is not used — per-recipient tracking allows future per-recipient suppression).
pkg/notification/slack.go
Slack notification dispatch via incoming webhooks. One HTTP POST per channel per send. Channels are notified in parallel.
Message format: plain text with Markdown-like formatting that Slack renders. The message template is evaluated against the full resolver data map before dispatch so it can reference .spec.*, .metadata.*, .status.*, metrics.*, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationStack ¶
type NotificationStack struct {
Katalog *katalog.Katalog
State *NotificationState
ResolverData map[string]interface{}
}
type NotificationState ¶
type NotificationState struct {
// key: operatorName + "|" + conditionKey + "|" + teamName
LastSent map[string]time.Time
}
NotificationState tracks last-send timestamps per condition+team.
func NewNotificationState ¶
func NewNotificationState() *NotificationState
func (*NotificationState) ProcessConditionNotifications ¶
func (s *NotificationState) ProcessConditionNotifications( ctx context.Context, k *katalog.Katalog, data map[string]interface{}, cond orktypes.Condition, now time.Time, )
ProcessConditionNotifications evaluates notify: for a single condition, tracking transitions and enforcing per-team intervals.
Called after we've already decided the condition is "passed" (true).
type SMTPConfig ¶ added in v0.1.9
type SMTPConfig struct {
Host string
Port string // default "587"
User string
Pass string
From string
}
SMTPConfig holds the SMTP connection parameters read from pkg/konfig. Constructed by the caller (notification.Notifier) from konfig at startup.
func (SMTPConfig) EffectivePort ¶ added in v0.1.9
func (c SMTPConfig) EffectivePort() string
EffectivePort returns the port, defaulting to 587 (STARTTLS submission).
func (SMTPConfig) IsConfigured ¶ added in v0.1.9
func (c SMTPConfig) IsConfigured() bool
IsConfigured returns true when the minimum required SMTP fields are present.