Skip to content

Modern Docker Management, Designed for Everyone

fix: keep build image refs when compose fails to load and document the update-check label (#4406)

Kyle Mendell1d3c5eb2ec14
diff --git a/backend/internal/project/service.go b/backend/internal/project/service.go
index 7efcf7816..1c738533b 100644
--- a/backend/internal/project/service.go
+++ b/backend/internal/project/service.go
@@ -33,7 +33,7 @@ import (
acfstypes "go.getarcane.app/acfs/types"
"go.getarcane.app/docker"
dockertypes "go.getarcane.app/docker/types"
- "go.getarcane.app/kit/pkg"
+ kit "go.getarcane.app/kit/pkg"
"go.getarcane.app/kit/pkg/mapping"
"go.getarcane.app/sys/cgroup"
"go.getarcane.app/updater"
@@ -2438,14 +2438,10 @@ func (s *ProjectService) refreshProjectImageRefs(ctx context.Context, proj *Proj
if dbErr := s.db.WithContext(ctx).
Model(&Project{}).
Where("id = ?", proj.ID).
- Updates(map[string]any{
- "image_refs_json": "",
- "build_image_refs_json": nil,
- }).Error; dbErr != nil {
+ Update("image_refs_json", "").Error; dbErr != nil {
slog.WarnContext(ctx, "failed to clear stale project image refs", "projectId", proj.ID, "error", dbErr)
}
proj.ImageRefsJSON = ""
- proj.BuildImageRefsJSON = nil
slog.WarnContext(ctx, "failed to refresh project image refs", "projectId", proj.ID, "projectName", proj.Name, "error", fmt.Errorf("load compose project: %w", err))
return
}
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 1f5fc300d..cd1a3cbea 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -296,6 +296,7 @@
"auto_update_disabled_toast": "Auto-update disabled",
"auto_update_failed": "Failed to update auto-update setting",
"auto_update_controlled_by_label": "Controlled by Docker label",
+ "auto_update_controlled_by_label_checks_continue": "Auto-update is controlled by a Docker label. Update checks continue; to stop them, add the label {label}.",
"auto_update_status_unavailable": "Auto-update status is unavailable because this environment's agent does not report it. Update the agent to manage it here.",
"excluded_containers": "Excluded Containers",
"auto_heal_exclude_description": "Select containers to exclude from auto-heal monitoring.",
diff --git a/frontend/src/routes/(app)/updates/components/container-updates-table.svelte b/frontend/src/routes/(app)/updates/components/container-updates-table.svelte
index 35575a9fd..cb8365866 100644
--- a/frontend/src/routes/(app)/updates/components/container-updates-table.svelte
+++ b/frontend/src/routes/(app)/updates/components/container-updates-table.svelte
@@ -31,7 +31,7 @@
import { hasPermission } from '#lib/utils/auth.js';
import { bulkConfirmAndRun } from '#lib/utils/bulk-actions.js';
import { confirmAndUpdateContainer } from '#lib/utils/container-actions.js';
- import { isAutoUpdateLabelDisabled } from '#lib/utils/container-auto-update.js';
+ import { isAutoUpdateLabelDisabled, UPDATE_CHECK_LABEL } from '#lib/utils/container-auto-update.js';
import { createContainerUpdateActivityTracker } from '#lib/utils/container-update-activities.js';
import {
environmentHref,
@@ -118,7 +118,7 @@
if (!statusAvailable) {
autoUpdateTitle = m.auto_update_status_unavailable();
} else if (labelControlled) {
- autoUpdateTitle = m.auto_update_controlled_by_label();
+ autoUpdateTitle = m.auto_update_controlled_by_label_checks_continue({ label: `${UPDATE_CHECK_LABEL}=false` });
} else if (autoUpdateDisabled) {
autoUpdateTitle = m.auto_update_disabled_checks_continue();
}
@@ -268,7 +268,9 @@
{#if item.autoUpdateDisabled}
<Badge
variant="gray"
- title={item.labelControlled ? m.auto_update_controlled_by_label() : m.auto_update_disabled_checks_continue()}
+ title={item.labelControlled
+ ? m.auto_update_controlled_by_label_checks_continue({ label: `${UPDATE_CHECK_LABEL}=false` })
+ : m.auto_update_disabled_checks_continue()}
>
{m.updates_auto_update_disabled()}
</Badge>