Skip to content

Commit

Permalink
Merge pull request #490 from openinfradev/policy_notification_fix
Browse files Browse the repository at this point in the history
trivial. fix messageActionProposal on policy_notifications
  • Loading branch information
cho4036 authored May 13, 2024
2 parents 2f4e0e8 + 3e9bf39 commit 26c8650
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/usecase/system-notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ func (u *SystemNotificationUsecase) Create(ctx context.Context, input domain.Cre

if systemNotification.Annotations.AlertType == "POLICY_NOTIFICATION" {
dto.PolicyName = systemNotification.Annotations.PolicyName
if strings.Contains(systemNotification.Labels.AlertName, "policy-audited") {
dto.MessageActionProposal = "감사"
} else if strings.Contains(systemNotification.Labels.AlertName, "policy-blocked") {
dto.MessageActionProposal = "거부"
} else {
dto.MessageActionProposal = ""
}
}

_, err = u.repo.Create(ctx, dto)
Expand Down Expand Up @@ -346,8 +353,6 @@ func (u *SystemNotificationUsecase) makeAdditionalInfo(systemNotification *model
break
}
}

log.Info(context.TODO(), systemNotification.RawData)
}

func (u *SystemNotificationUsecase) makeGrafanaUrl(ctx context.Context, primaryCluster model.Cluster, systemNotification domain.SystemNotificationRequest, clusterId domain.ClusterId) (url string) {
Expand Down

0 comments on commit 26c8650

Please sign in to comment.