mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
fix(digest): check container image info for nil (#1027)
This commit is contained in:
parent
7221704638
commit
9bb8991a76
3 changed files with 17 additions and 1 deletions
|
@ -43,6 +43,11 @@ func CreateMockContainer(id string, name string, image string, created time.Time
|
|||
|
||||
// CreateMockContainerWithImageInfo should only be used for testing
|
||||
func CreateMockContainerWithImageInfo(id string, name string, image string, created time.Time, imageInfo types.ImageInspect) container.Container {
|
||||
return CreateMockContainerWithImageInfoP(id, name, image, created, &imageInfo)
|
||||
}
|
||||
|
||||
// CreateMockContainerWithImageInfoP should only be used for testing
|
||||
func CreateMockContainerWithImageInfoP(id string, name string, image string, created time.Time, imageInfo *types.ImageInspect) container.Container {
|
||||
content := types.ContainerJSON{
|
||||
ContainerJSONBase: &types.ContainerJSONBase{
|
||||
ID: id,
|
||||
|
@ -57,7 +62,7 @@ func CreateMockContainerWithImageInfo(id string, name string, image string, crea
|
|||
}
|
||||
return *container.NewContainer(
|
||||
&content,
|
||||
&imageInfo,
|
||||
imageInfo,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue