Skip to content

Commit a3674e1

Browse files
committed
fix: use UninstallBackend() to safely cleanup before reinstallation (closes #8118)
1 parent 0ee9231 commit a3674e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/gallery/backends.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ func InstallBackendFromGallery(ctx context.Context, galleries []config.Gallery,
9898
return fmt.Errorf("no backend found with name %q", name)
9999
}
100100

101+
if force {
102+
if err := DeleteBackendFromSystem(systemState, name); err != nil {
103+
return fmt.Errorf("failed to uninstall existing backend %s: %w", name, err)
104+
}
105+
}
106+
101107
if backend.IsMeta() {
102108
xlog.Debug("Backend is a meta backend", "systemState", systemState, "name", name)
103109

0 commit comments

Comments
 (0)