chore: update Docker API types to use new image package

This commit is contained in:
Jan Rundshagen 2025-03-29 12:39:57 +01:00 committed by Jan O. Rundshagen
parent d084f5604d
commit ca0d37a4ac
11 changed files with 89 additions and 978 deletions

View file

@ -11,14 +11,14 @@ import (
wt "github.com/beatkind/watchtower/pkg/types"
"github.com/sirupsen/logrus"
"github.com/docker/docker/api/types"
dockercontainer "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/go-connections/nat"
)
// NewContainer returns a new Container instance instantiated with the
// specified ContainerInfo and ImageInfo structs.
func NewContainer(containerInfo *types.ContainerJSON, imageInfo *types.ImageInspect) *Container {
func NewContainer(containerInfo *dockercontainer.InspectResponse, imageInfo *image.InspectResponse) *Container {
return &Container{
containerInfo: containerInfo,
imageInfo: imageInfo,
@ -30,8 +30,8 @@ type Container struct {
LinkedToRestarting bool
Stale bool
containerInfo *types.ContainerJSON
imageInfo *types.ImageInspect
containerInfo *dockercontainer.InspectResponse
imageInfo *image.InspectResponse
}
// IsLinkedToRestarting returns the current value of the LinkedToRestarting field for the container
@ -55,7 +55,7 @@ func (c *Container) SetStale(value bool) {
}
// ContainerInfo fetches JSON info for the container
func (c Container) ContainerInfo() *types.ContainerJSON {
func (c Container) ContainerInfo() *dockercontainer.InspectResponse {
return c.containerInfo
}
@ -368,7 +368,7 @@ func (c Container) HasImageInfo() bool {
}
// ImageInfo fetches the ImageInspect data of the current container
func (c Container) ImageInfo() *types.ImageInspect {
func (c Container) ImageInfo() *image.InspectResponse {
return c.imageInfo
}