mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-25 16:34:07 +01:00
chore: update Docker API types to use new image package
This commit is contained in:
parent
d084f5604d
commit
ca0d37a4ac
11 changed files with 89 additions and 978 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue