feat: 存储卷清理增加清除所有标签

This commit is contained in:
ssonglius11 2024-05-13 10:39:16 +08:00
parent 79c2ba2125
commit c25e5b1e9a

View file

@ -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