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:
nemezo 2024-10-31 14:27:34 +01:00
parent 76f9cea516
commit e0cbe337d7
No known key found for this signature in database
GPG key ID: FC41783B3CB4CCE8
9 changed files with 216 additions and 169 deletions

View file

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