mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
#387 fix: switch to image id map and add additional tests
This commit is contained in:
parent
4e000fa89c
commit
7b8b8e8ad9
9 changed files with 244 additions and 102 deletions
28
internal/actions/mocks/container.go
Normal file
28
internal/actions/mocks/container.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
"github.com/containrrr/watchtower/pkg/container"
|
||||
"github.com/docker/docker/api/types"
|
||||
container2 "github.com/docker/docker/api/types/container"
|
||||
"time"
|
||||
)
|
||||
|
||||
func CreateMockContainer(id string, name string, image string, created time.Time) container.Container {
|
||||
content := types.ContainerJSON{
|
||||
ContainerJSONBase: &types.ContainerJSONBase{
|
||||
ID: id,
|
||||
Image: image,
|
||||
Name: name,
|
||||
Created: created.String(),
|
||||
},
|
||||
Config: &container2.Config{
|
||||
Labels: make(map[string]string),
|
||||
},
|
||||
}
|
||||
return *container.NewContainer(
|
||||
&content,
|
||||
&types.ImageInspect{
|
||||
ID: image,
|
||||
},
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue