From c25e5b1e9a7789d1cba6c702f8eb3e81fe11d07b Mon Sep 17 00:00:00 2001 From: ssonglius11 Date: Mon, 13 May 2024 10:39:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AD=98=E5=82=A8=E5=8D=B7=E6=B8=85?= =?UTF-8?q?=E7=90=86=E5=A2=9E=E5=8A=A0=E6=B8=85=E9=99=A4=E6=89=80=E6=9C=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/container.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/app/service/container.go b/backend/app/service/container.go index 1d8debab1..7225345e5 100644 --- a/backend/app/service/container.go +++ b/backend/app/service/container.go @@ -323,6 +323,13 @@ func (u *ContainerService) Prune(req dto.ContainerPrune) (dto.ContainerPruneRepo } report.DeletedNumber = len(rep.NetworksDeleted) case "volume": + versions, err := client.ServerVersion(context.Background()) + if err != nil { + return report, err + } + if common.ComparePanelVersion(versions.APIVersion, "1.42") { + pruneFilters.Add("all", "true") + } rep, err := client.VolumesPrune(context.Background(), pruneFilters) if err != nil { return report, err