mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-28 04:38:48 +01:00
Add test cases and data for testing defer-days functionality
This commit is contained in:
parent
722173bcdc
commit
0d1d7979cb
2 changed files with 67 additions and 0 deletions
|
|
@ -79,6 +79,13 @@ func CreateMockContainerWithDigest(id string, name string, image string, created
|
|||
return c
|
||||
}
|
||||
|
||||
// CreateMockContainerWithDigest should only be used for testing
|
||||
func CreateMockContainerWithImageCreatedTime(id string, name string, image string, created time.Time, imageCreated time.Time) wt.Container {
|
||||
c := CreateMockContainer(id, name, image, created)
|
||||
c.ImageInfo().Created = imageCreated.UTC().Format(time.RFC3339)
|
||||
return c
|
||||
}
|
||||
|
||||
// CreateMockContainerWithConfig creates a container substitute valid for testing
|
||||
func CreateMockContainerWithConfig(id string, name string, image string, running bool, restarting bool, created time.Time, config *dockerContainer.Config) wt.Container {
|
||||
content := types.ContainerJSON{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue