Skip to content

Commit

Permalink
fix panic if image not empty and not rednered in notification (#3946)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zhao <zhaoyu@koderover.com>
  • Loading branch information
PetrusZ authored Jan 7, 2025
1 parent 683ca87 commit 7a6dfe9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func (w *Service) getNotificationContent(notify *models.NotifyCtl, task *models.
}
}
}
if image != "" {
if image != "" && !strings.HasPrefix(image, "{{.") && !strings.Contains(image, "}}") {
jobTplcontent += fmt.Sprintf("{{if eq .WebHookType \"dingding\"}}##### {{end}}**镜像信息**:%s \n", image)
mailJobTplcontent += fmt.Sprintf("镜像信息:%s \n", image)
workflowNotifyJobTaskSpec.Image = image
Expand Down

0 comments on commit 7a6dfe9

Please sign in to comment.