Skip to content

Modern Docker Management, Designed for Everyone

feat(notifications): batch container-update notifications (#3650)

Zuiyu0239f62b45c7
diff --git a/backend/internal/notification/notification.go b/backend/internal/notification/notification.go
index 126cd6ad5..644ee921b 100644
--- a/backend/internal/notification/notification.go
+++ b/backend/internal/notification/notification.go
@@ -12,6 +12,7 @@ import (
"maps"
"net/http"
"net/mail"
+ "sort"
"strings"
"time"
@@ -267,6 +268,21 @@ func (s *NotificationService) dispatchForTargetInternal(ctx context.Context, tar
}
logManagerDispatchNotificationInternal(ctx, target, payload.Kind)
return dispatchResponse, s.sendContainerUpdateNotificationForTargetInternal(ctx, target, payload.ContainerUpdate.ContainerName, payload.ContainerUpdate.ImageRef, payload.ContainerUpdate.OldDigest, payload.ContainerUpdate.NewDigest)
+ case notificationdto.DispatchKindBatchContainerUpdate:
+ if payload.BatchContainerUpdate == nil {
+ return notificationdto.DispatchResponse{}, errors.New("batch container update payload is required")
+ }
+ logManagerDispatchNotificationInternal(ctx, target, payload.Kind)
+ entries := make([]notifications.ContainerUpdateBatchEntry, 0, len(payload.BatchContainerUpdate.Updates))
+ for _, update := range payload.BatchContainerUpdate.Updates {
+ entries = append(entries, notifications.ContainerUpdateBatchEntry{
+ ContainerName: update.ContainerName,
+ ImageRef: update.ImageRef,
+ OldDigest: update.OldDigest,
+ NewDigest: update.NewDigest,
+ })
+ }
+ return dispatchResponse, s.sendBatchContainerUpdateNotificationForTargetInternal(ctx, target, entries)
case notificationdto.DispatchKindVulnerabilityFound:
if payload.VulnerabilityFound == nil {
return notificationdto.DispatchResponse{}, errors.New("vulnerability payload is required")
@@ -720,6 +736,144 @@ func (s *NotificationService) batchImageUpdateNotificationContentInternal(enviro
}
}
+// SendBatchContainerUpdateNotification dispatches a single batched
+// notification covering all containers updated in one auto-update run.
+func (s *NotificationService) SendBatchContainerUpdateNotification(ctx context.Context, entries []notifications.ContainerUpdateBatchEntry) error {
+ if len(entries) == 0 {
+ return nil
+ }
+
+ if s.config != nil && s.config.AgentMode {
+ updates := make([]notificationdto.DispatchContainerUpdate, 0, len(entries))
+ for _, entry := range entries {
+ updates = append(updates, notificationdto.DispatchContainerUpdate{
+ ContainerName: entry.ContainerName,
+ ImageRef: entry.ImageRef,
+ OldDigest: entry.OldDigest,
+ NewDigest: entry.NewDigest,
+ })
+ }
+ _, err := s.dispatchNotificationToManagerInternal(ctx, notificationdto.DispatchRequest{
+ Kind: notificationdto.DispatchKindBatchContainerUpdate,
+ BatchContainerUpdate: &notificationdto.DispatchBatchContainerUpdate{Updates: updates},
+ })
+ return err
+ }
+
+ target, err := s.resolveNotificationTargetInternal(ctx, "")
+ if err != nil {
+ return err
+ }
+
+ return s.sendBatchContainerUpdateNotificationForTargetInternal(ctx, target, entries)
+}
+
+func (s *NotificationService) sendBatchContainerUpdateNotificationForTargetInternal(ctx context.Context, target NotificationTarget, entries []notifications.ContainerUpdateBatchEntry) error {
+ containerNames := make([]string, 0, len(entries))
+ for _, entry := range entries {
+ containerNames = append(containerNames, entry.ContainerName)
+ }
+
+ metadata := database.JSON{
+ "containerNames": containerNames,
+ "updateCount": len(entries),
+ "eventType": string(notifications.NotificationEventContainerUpdate),
+ "batch": true,
+ }
+ content := s.batchContainerUpdateNotificationContentInternal(target.EnvironmentName, entries)
+ content.Vars = notifications.EventVars(target.EnvironmentName, target.EnvironmentID, notifications.NotificationEventContainerUpdate)
+ _, err := s.notifyEnabledProvidersInternal(ctx, target, notifications.NotificationEventContainerUpdate, strings.Join(containerNames, ", "), metadata, func(ctx context.Context, provider notifications.NotificationProvider, config database.JSON) (bool, error) {
+ return notifications.Deliver(ctx, provider, config, content)
+ })
+ return err
+}
+
+func (s *NotificationService) batchContainerUpdateNotificationContentInternal(environmentName string, entries []notifications.ContainerUpdateBatchEntry) notifications.Content {
+ return notifications.Content{
+ Text: notifications.TextByFormat(func(format notifications.MessageFormat) string {
+ return notifications.BuildBatchContainerUpdateNotificationMessage(format, environmentName, entries)
+ }),
+ Title: "Containers Updated",
+ RenderEmail: func() (string, string, error) {
+ htmlBody, _, err := s.renderBatchContainerUpdateEmailTemplate(environmentName, entries)
+ if err != nil {
+ return "", "", errors.WrapIf(err, "failed to render email template")
+ }
+ updateCount := len(entries)
+ plural := ""
+ if updateCount > 1 {
+ plural = "s"
+ }
+ subject := notifications.BuildEmailSubject(environmentName, fmt.Sprintf("%d Container%s Updated", updateCount, plural))
+ return subject, htmlBody, nil
+ },
+ RequireNtfyTopic: true,
+ ValidatePushoverUser: true,
+ }
+}
+
+func (s *NotificationService) renderBatchContainerUpdateEmailTemplate(environmentName string, entries []notifications.ContainerUpdateBatchEntry) (string, string, error) {
+ type batchEntry struct {
+ ContainerName string
+ ImageRef string
+ OldDigest string
+ NewDigest string
+ }
+
+ sorted := make([]batchEntry, 0, len(entries))
+ for _, entry := range entries {
+ sorted = append(sorted, batchEntry{
+ ContainerName: entry.ContainerName,
+ ImageRef: entry.ImageRef,
+ OldDigest: entry.OldDigest,
+ NewDigest: entry.NewDigest,
+ })
+ }
+ sort.Slice(sorted, func(i, j int) bool { return sorted[i].ContainerName < sorted[j].ContainerName })
+
+ appURL := s.config.GetAppURL()
+ data := map[string]any{
+ "LogoURL": appURL + logoURLPath,
+ "AppURL": appURL,
+ "Environment": environmentName,
+ "UpdateCount": len(sorted),
+ "CompletedAt": time.Now().Format(time.RFC1123),
+ "Entries": sorted,
+ }
+
+ htmlContent, err := resources.FS.ReadFile("email-templates/batch-container-updates_html.tmpl")
+ if err != nil {
+ return "", "", errors.WrapIf(err, "failed to read HTML template")
+ }
+
+ htmlTmpl, err := template.New("html").Parse(string(htmlContent))
+ if err != nil {
+ return "", "", errors.WrapIf(err, "failed to parse HTML template")
+ }
+
+ var htmlBuf bytes.Buffer
+ if err := htmlTmpl.ExecuteTemplate(&htmlBuf, "root", data); err != nil {
+ return "", "", errors.WrapIf(err, "failed to execute HTML template")
+ }
+
+ textContent, err := resources.FS.ReadFile("email-templates/batch-container-updates_text.tmpl")
+ if err != nil {
+ return "", "", errors.WrapIf(err, "failed to read text template")
+ }
+
+ textTmpl, err := template.New("text").Parse(string(textContent))
+ if err != nil {
+ return "", "", errors.WrapIf(err, "failed to parse text template")
+ }
+
+ var textBuf bytes.Buffer
+ if err := textTmpl.ExecuteTemplate(&textBuf, "root", data); err != nil {
+ return "", "", errors.WrapIf(err, "failed to execute text template")
+ }
+
+ return htmlBuf.String(), textBuf.String(), nil
+}
+
func (s *NotificationService) pruneReportNotificationContentInternal(environmentName string, result *system.PruneAllResult) notifications.Content {
defaultTitle := notifications.BuildEmailSubject(environmentName, "System Prune Report")
return notifications.Content{
diff --git a/backend/internal/updater/service.go b/backend/internal/updater/service.go
index 4603078d2..64b08a628 100644
--- a/backend/internal/updater/service.go
+++ b/backend/internal/updater/service.go
@@ -34,6 +34,7 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/timeouts"
projectspkg "github.com/getarcaneapp/arcane/backend/v2/pkg/projects"
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils"
+ "github.com/getarcaneapp/arcane/backend/v2/pkg/utils/notifications"
arcaneupdater "github.com/getarcaneapp/arcane/types/v2/updater"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/client"
@@ -174,8 +175,11 @@ func (s *UpdaterService) ApplyPending(ctx context.Context, options arcaneupdater
out = &arcaneupdater.Result{Items: []arcaneupdater.ResourceResult{}, ActivityID: mo.EmptyableToOption(strings.TrimSpace(activityID)).ToPointer()}
ctx = s.trackActivityInternal(ctx, activityID)
ctx = contextWithActivityIDInternal(ctx, activityID)
+ notifyBatch := &containerUpdateBatchInternal{}
+ ctx = context.WithValue(ctx, containerUpdateBatchContextKeyInternal{}, notifyBatch)
defer func() {
+ s.flushBatchedContainerUpdatesInternal(ctx, notifyBatch)
if out == nil {
out = &arcaneupdater.Result{Items: []arcaneupdater.ResourceResult{}}
}
@@ -718,11 +722,25 @@ func (s *UpdaterService) markSelfUpdateTriggeredInternal(ctx context.Context, ta
}
}
-// Notify sends Arcane's container update notification.
+// Notify buffers Arcane's container update notification when called within an
+// auto-update run (see withBatchedNotificationsInternal); buffered entries are
+// flushed as one batched notification when the run completes. Outside a run it
+// sends the legacy per-container notification immediately.
func (s *UpdaterService) Notify(ctx context.Context, notification updater.Notification) error {
if s == nil || s.deps.Notifications == nil {
return nil
}
+ if buffer := batchedContainerUpdatesFromContextInternal(ctx); buffer != nil {
+ buffer.Lock()
+ buffer.entries = append(buffer.entries, notifications.ContainerUpdateBatchEntry{
+ ContainerName: notification.ContainerName,
+ ImageRef: notification.ImageRef,
+ OldDigest: notification.OldImage,
+ NewDigest: notification.NewImage,
+ })
+ buffer.Unlock()
+ return nil
+ }
return s.deps.Notifications.SendContainerUpdateNotification(
ctx,
notification.ContainerName,
@@ -732,6 +750,39 @@ func (s *UpdaterService) Notify(ctx context.Context, notification updater.Notifi
)
}
+// containerUpdateBatchInternal accumulates per-container update notifications
+// so a single auto-update run produces one batched notification.
+type containerUpdateBatchInternal struct {
+ sync.Mutex
+
+ entries []notifications.ContainerUpdateBatchEntry
+}
+
+type containerUpdateBatchContextKeyInternal struct{}
+
+func batchedContainerUpdatesFromContextInternal(ctx context.Context) *containerUpdateBatchInternal {
+ batch, _ := ctx.Value(containerUpdateBatchContextKeyInternal{}).(*containerUpdateBatchInternal)
+ return batch
+}
+
+// flushBatchedContainerUpdatesInternal delivers the accumulated container
+// update notifications as one batched notification.
+func (s *UpdaterService) flushBatchedContainerUpdatesInternal(ctx context.Context, batch *containerUpdateBatchInternal) {
+ if s == nil || s.deps.Notifications == nil || batch == nil {
+ return
+ }
+ batch.Lock()
+ entries := batch.entries
+ batch.entries = nil
+ batch.Unlock()
+ if len(entries) == 0 {
+ return
+ }
+ if err := s.deps.Notifications.SendBatchContainerUpdateNotification(ctx, entries); err != nil {
+ s.loggerInternal().ErrorContext(ctx, "failed to send batched container update notification", "error", err, "count", len(entries))
+ }
+}
+
// RecordEvent records updater lifecycle events in Arcane's event stream.
func (s *UpdaterService) RecordEvent(ctx context.Context, evt updater.Event) error {
if s == nil {
diff --git a/backend/pkg/utils/notifications/messages.go b/backend/pkg/utils/notifications/messages.go
index 5fc5b3382..d2450bfbe 100644
--- a/backend/pkg/utils/notifications/messages.go
+++ b/backend/pkg/utils/notifications/messages.go
@@ -157,6 +157,56 @@ func BuildBatchImageUpdateNotificationMessage(format MessageFormat, environmentN
return message.String()
}
+// ContainerUpdateBatchEntry describes one container updated as part of a batch.
+type ContainerUpdateBatchEntry struct {
+ ContainerName string
+ ImageRef string
+ OldDigest string
+ NewDigest string
+}
+
+// BuildBatchContainerUpdateNotificationMessage builds a formatted notification for a batch of container updates.
+func BuildBatchContainerUpdateNotificationMessage(format MessageFormat, environmentName string, entries []ContainerUpdateBatchEntry) string {
+ title := "Containers Updated"
+ description := fmt.Sprintf("%d container(s) were updated.", len(entries))
+ if len(entries) == 1 {
+ title = "Container Updated"
+ description = "1 container was updated."
+ }
+
+ sorted := make([]ContainerUpdateBatchEntry, len(entries))
+ copy(sorted, entries)
+ sort.Slice(sorted, func(i, j int) bool { return sorted[i].ContainerName < sorted[j].ContainerName })
+
+ var message strings.Builder
+ fmt.Fprintf(&message, "%s\n\n%s\n", formatNotificationTitleInternal(format, title), description)
+ fmt.Fprintf(&message, "%s %s\n\n", formatNotificationLabelInternal(format, "Environment"), environmentName)
+
+ for _, entry := range sorted {
+ switch format {
+ case MessageFormatPlain:
+ fmt.Fprintf(&message, "%s\n", entry.ContainerName)
+ case MessageFormatMarkdown:
+ fmt.Fprintf(&message, "**%s**\n", entry.ContainerName)
+ case MessageFormatSlack:
+ fmt.Fprintf(&message, "*%s*\n", entry.ContainerName)
+ case MessageFormatHTML:
+ fmt.Fprintf(&message, "<b>%s</b>\n", entry.ContainerName)
+ }
+ fmt.Fprintf(&message, "• Image: %s\n", entry.ImageRef)
+ if entry.OldDigest != "" {
+ fmt.Fprintf(&message, "• Previous Version: %s\n", formatNotificationCodeInternal(format, entry.OldDigest))
+ }
+ if entry.NewDigest != "" {
+ fmt.Fprintf(&message, "• Current Version: %s\n\n", formatNotificationCodeInternal(format, entry.NewDigest))
+ } else {
+ fmt.Fprintf(&message, "\n")
+ }
+ }
+
+ return message.String()
+}
+
func BuildVulnerabilitySummaryNotificationMessage(format MessageFormat, environmentName, summaryLabel, overview, fixableCount, severityBreakdown, sampleCVEs string) string {
var message strings.Builder
fmt.Fprintf(&message, "%s\n\n", formatNotificationTitleInternal(format, "📊 Daily Vulnerability Summary"))
diff --git a/backend/resources/email-templates/batch-container-updates_html.tmpl b/backend/resources/email-templates/batch-container-updates_html.tmpl
new file mode 100644
index 000000000..0e5804e7e
--- /dev/null
+++ b/backend/resources/email-templates/batch-container-updates_html.tmpl
@@ -0,0 +1,7 @@
+{{define "root"}}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html dir="ltr" lang="en"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><meta name="x-apple-disable-message-reformatting"/></head><body dir="ltr" lang="en" style="background-color:#24262b;padding:0"><table border="0" width="100%" cellPadding="0" cellSpacing="0" role="presentation" align="center"><tbody><tr><td dir="ltr" lang="en" style="padding:40px 20px;background-color:#24262b;font-family:&#x27;Montserrat&#x27;, -apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, Roboto, &#x27;Helvetica Neue&#x27;, Arial, sans-serif"><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="max-width:37.5em;width:600px;margin:0 auto"><tbody><tr style="width:100%"><td>
+<table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="text-align:center;margin-bottom:32px"><tbody><tr><td><img alt="Arcane" height="auto" src="{{.LogoURL}}" style="display:inline-block;outline:none;border:none;text-decoration:none;width:180px;height:auto" width="180"/></td></tr></tbody></table><div style="background-color:#31343a;border:1px solid #3a3e45;padding:32px;border-radius:14px;box-shadow:none"><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation"><tbody style="width:100%"><tr style="width:100%"><td data-id="__react-email-column"><h1 style="font-size:24px;font-weight:bold;margin:0;color:#f5f7fa;font-family:&#x27;Geist Mono&#x27;, ui-monospace, SFMono-Regular, Menlo, Monaco, &#x27;Courier New&#x27;, monospace">Containers Updated</h1></td><td align="right" data-id="__react-email-column"></td></tr></tbody></table>
+<table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-top:24px"><tbody><tr><td><p style="font-size:16px;line-height:24px;color:#c7cbd1;margin:0 0 16px 0;margin-top:0;margin-right:0;margin-bottom:16px;margin-left:0">{{.UpdateCount}} container(s) were updated with the latest image version.</p></td></tr></tbody></table><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-top:20px;background-color:#2b2e34;border:1px solid #3a3e45;border-radius:10px"><tbody><tr><td style="padding:20px"><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-bottom:0"><tbody style="width:100%"><tr style="width:100%"><td data-id="__react-email-column" style="width:160px;vertical-align:top;padding-right:12px"><p style="font-size:14px;line-height:24px;font-weight:600;color:#9298a3;margin:8px 0;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0"
+>Environment:</p></td><td data-id="__react-email-column"><p style="font-size:14px;line-height:24px;color:#e6e8ec;margin:8px 0;word-break:break-word;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0">{{.Environment}}</p></td></tr></tbody></table><hr style="width:100%;border:none;border-color:#3a3e45;border-top:1px solid #eaeaea;margin:4px 0"/><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-bottom:0"><tbody style="width:100%"><tr style="width:100%"><td data-id="__react-email-column" style="width:160px;vertical-align:top;padding-right:12px"><p style="font-size:14px;line-height:24px;font-weight:600;color:#9298a3;margin:8px 0;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0">Containers Updated:</p></td><td data-id="__react-email-column"><p style="font-size:24px;line-height:24px;font-weight:700;color:#34d399;margin:8px 0;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0">{{.UpdateCount}}</p>
+</td></tr></tbody></table><hr style="width:100%;border:none;border-color:#3a3e45;border-top:1px solid #eaeaea;margin:4px 0"/><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-bottom:0"><tbody style="width:100%"><tr style="width:100%"><td data-id="__react-email-column" style="width:160px;vertical-align:top;padding-right:12px"><p style="font-size:14px;line-height:24px;font-weight:600;color:#9298a3;margin:8px 0;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0">Completed At:</p></td><td data-id="__react-email-column"><p style="font-size:14px;line-height:24px;color:#e6e8ec;margin:8px 0;word-break:break-word;margin-top:8px;margin-right:0;margin-bottom:8px;margin-left:0">{{.CompletedAt}}</p></td></tr></tbody></table></td></tr></tbody></table>
+<table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-top:24px;background-color:#2b2e34;border:1px solid #3a3e45;border-radius:10px"><tbody><tr><td style="padding:16px"><p style="font-size:14px;line-height:24px;font-weight:600;color:#9298a3;margin:0 0 12px 0;margin-top:0;margin-right:0;margin-bottom:12px;margin-left:0">Updated Containers:</p>{{range .Entries}}<p style="font-size:13px;line-height:20px;color:#e6e8ec;margin:4px 0 2px 0;font-family:'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Courier New', monospace">• {{.ContainerName}}</p><p style="font-size:12px;line-height:18px;color:#c7cbd1;margin:0 0 8px 0;font-family:'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, 'Courier New', monospace">&#160;&#160;&#160;{{.ImageRef}}</p>{{end}}</td></tr></tbody></table><table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="margin-top:24px"><tbody><tr><td><p style="font-size:13px;line-height:20px;color:#9298a3;margin:0;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0">Log in to Arcane to view details about your containers.</p></td></tr></tbody></table></div>
+<table align="center" width="100%" border="0" cellPadding="0" cellSpacing="0" role="presentation" style="text-align:center;margin-top:32px"><tbody><tr><td style="padding-top:24px"><p style="font-size:14px;line-height:20px;margin:0;color:#9298a3;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0"><a href="{{.AppURL}}" style="color:#a855f7;text-decoration-line:none;text-decoration:none;font-weight:500" target="_blank">Open Arcane Dashboard -></a></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></body></html>{{end}}
diff --git a/backend/resources/email-templates/batch-container-updates_text.tmpl b/backend/resources/email-templates/batch-container-updates_text.tmpl
new file mode 100644
index 000000000..e9fe485fa
--- /dev/null
+++ b/backend/resources/email-templates/batch-container-updates_text.tmpl
@@ -0,0 +1,14 @@
+{{define "root"}}Arcane - Containers Updated
+
+{{.UpdateCount}} container(s) were updated with the latest image version.
+
+Environment: {{.Environment}}
+Completed At: {{.CompletedAt}}
+
+Updated Containers:
+{{range .Entries}}- {{.ContainerName}} ({{.ImageRef}})
+{{end}}
+
+Log in to Arcane to view details about your containers:
+{{.AppURL}}
+{{end}}
diff --git a/types/notification/notification.go b/types/notification/notification.go
index 1e7c20438..1b82aa755 100644
--- a/types/notification/notification.go
+++ b/types/notification/notification.go
@@ -96,12 +96,13 @@ type TestResponse struct {
type DispatchKind string
const (
- DispatchKindImageUpdate DispatchKind = "image_update"
- DispatchKindBatchImageUpdate DispatchKind = "batch_image_update"
- DispatchKindContainerUpdate DispatchKind = "container_update"
- DispatchKindVulnerabilityFound DispatchKind = "vulnerability_found"
- DispatchKindPruneReport DispatchKind = "prune_report"
- DispatchKindAutoHeal DispatchKind = "auto_heal"
+ DispatchKindImageUpdate DispatchKind = "image_update"
+ DispatchKindBatchImageUpdate DispatchKind = "batch_image_update"
+ DispatchKindContainerUpdate DispatchKind = "container_update"
+ DispatchKindBatchContainerUpdate DispatchKind = "batch_container_update"
+ DispatchKindVulnerabilityFound DispatchKind = "vulnerability_found"
+ DispatchKindPruneReport DispatchKind = "prune_report"
+ DispatchKindAutoHeal DispatchKind = "auto_heal"
)
type DispatchImageUpdate struct {
@@ -120,6 +121,10 @@ type DispatchContainerUpdate struct {
NewDigest string `json:"newDigest,omitempty"`
}
+type DispatchBatchContainerUpdate struct {
+ Updates []DispatchContainerUpdate `json:"updates"`
+}
+
type DispatchVulnerabilityFound struct {
CVEID string `json:"cveId"`
CVELink string `json:"cveLink"`
@@ -140,13 +145,14 @@ type DispatchAutoHeal struct {
}
type DispatchRequest struct {
- Kind DispatchKind `json:"kind"`
- ImageUpdate *DispatchImageUpdate `json:"imageUpdate,omitempty"`
- BatchImageUpdate *DispatchBatchImageUpdate `json:"batchImageUpdate,omitempty"`
- ContainerUpdate *DispatchContainerUpdate `json:"containerUpdate,omitempty"`
- VulnerabilityFound *DispatchVulnerabilityFound `json:"vulnerabilityFound,omitempty"`
- PruneReport *DispatchPruneReport `json:"pruneReport,omitempty"`
- AutoHeal *DispatchAutoHeal `json:"autoHeal,omitempty"`
+ Kind DispatchKind `json:"kind"`
+ ImageUpdate *DispatchImageUpdate `json:"imageUpdate,omitempty"`
+ BatchImageUpdate *DispatchBatchImageUpdate `json:"batchImageUpdate,omitempty"`
+ ContainerUpdate *DispatchContainerUpdate `json:"containerUpdate,omitempty"`
+ BatchContainerUpdate *DispatchBatchContainerUpdate `json:"batchContainerUpdate,omitempty"`
+ VulnerabilityFound *DispatchVulnerabilityFound `json:"vulnerabilityFound,omitempty"`
+ PruneReport *DispatchPruneReport `json:"pruneReport,omitempty"`
+ AutoHeal *DispatchAutoHeal `json:"autoHeal,omitempty"`
}
type DispatchResponse struct {