File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func newDatadog() datadog {
4242}
4343
4444func (d datadog ) SuccessEvent (jobInfo JobInfo ) (err error ) {
45- if isSubscriptionSuppressed (jobInfo .Annotations , suppressFailedAnnotationName ) {
45+ if isSubscriptionSuppressed (jobInfo .Annotations , suppressSuccessAnnotationName ) {
4646 klog .Infof ("Notification for %s is suppressed" , jobInfo .Name )
4747 return nil
4848 }
@@ -66,7 +66,7 @@ func (d datadog) SuccessEvent(jobInfo JobInfo) (err error) {
6666}
6767
6868func (d datadog ) FailEvent (jobInfo JobInfo ) (err error ) {
69- if isSubscriptionSuppressed (jobInfo .Annotations , suppressSuccessAnnotationName ) {
69+ if isSubscriptionSuppressed (jobInfo .Annotations , suppressFailedAnnotationName ) {
7070 klog .Infof ("Notification for %s is suppressed" , jobInfo .Name )
7171 return nil
7272 }
Original file line number Diff line number Diff line change @@ -54,6 +54,22 @@ func TestisSubscriptionSuppressed(t *testing.T) {
5454 "kube-job-notifier/suppress-success-datadog-subscription" ,
5555 true ,
5656 },
57+ {
58+ "Annotation not true" ,
59+ map [string ]string {
60+ "kube-job-notifier/suppress-failed-datadog-subscription" : "false" ,
61+ },
62+ "kube-job-notifier/suppress-failed-datadog-subscription" ,
63+ false ,
64+ },
65+ {
66+ "Annotation true" ,
67+ map [string ]string {
68+ "kube-job-notifier/suppress-failed-datadog-subscription" : "true" ,
69+ },
70+ "kube-job-notifier/suppress-failed-datadog-subscription" ,
71+ true ,
72+ },
5773 {
5874 "Nil annotation not break" ,
5975 nil ,
You can’t perform that action at this time.
0 commit comments