mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-22 07:04:07 +01:00
chore(deps): bump go/stdlib to v1.23.x and update go modules
- Upgraded `go.mod` to use Go 1.23 and updated module dependencies to latest versions - Refactored code to align with API changes in Docker and related modules: - Updated `ContainerListOptions` to `container.ListOptions` and related structs - Replaced `types.ImageDeleteResponseItem` with `image.DeleteResponse` for compatibility - Modified `ImagePullOptions` and `ContainerRemoveOptions` to updated package paths
This commit is contained in:
parent
76f9cea516
commit
e0cbe337d7
9 changed files with 216 additions and 169 deletions
|
|
@ -14,6 +14,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
O "github.com/onsi/gomega"
|
||||
"github.com/onsi/gomega/ghttp"
|
||||
)
|
||||
|
|
@ -259,15 +260,15 @@ func RemoveImageHandler(imagesWithParents map[string][]string) http.HandlerFunc
|
|||
ghttp.VerifyRequest("DELETE", O.MatchRegexp("/images/.*")),
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
parts := strings.Split(r.URL.Path, `/`)
|
||||
image := parts[len(parts)-1]
|
||||
testimage := parts[len(parts)-1]
|
||||
|
||||
if parents, found := imagesWithParents[image]; found {
|
||||
items := []types.ImageDeleteResponseItem{
|
||||
{Untagged: image},
|
||||
{Deleted: image},
|
||||
if parents, found := imagesWithParents[testimage]; found {
|
||||
items := []image.DeleteResponse{
|
||||
{Untagged: testimage},
|
||||
{Deleted: testimage},
|
||||
}
|
||||
for _, parent := range parents {
|
||||
items = append(items, types.ImageDeleteResponseItem{Deleted: parent})
|
||||
items = append(items, image.DeleteResponse{Deleted: parent})
|
||||
}
|
||||
ghttp.RespondWithJSONEncoded(http.StatusOK, items)(w, r)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue