소스 검색

Rewrote creation of images tag

Magnus Berglund 6 년 전
부모
커밋
e6623de6b2
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 6
      pkg/services/alerting/notifiers/teams.go

+ 4 - 6
pkg/services/alerting/notifiers/teams.go

@@ -78,13 +78,11 @@ func (this *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error {
 		message = evalContext.Rule.Message
 	}
 
-	images := ""
+	images := make([]map[string]interface{}, 0)
 	if evalContext.ImagePublicUrl != "" {
-		images = []map[string]interface{}{
-			{
-				"image": evalContext.ImagePublicUrl,
-			},
-		}
+		images = append(images, map[string]interface{}{
+			"image": evalContext.ImagePublicUrl,
+		})
 	}
 
 	body := map[string]interface{}{