mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
Make it possible to use watchtower to update exited or created containers as well (#289)
* feature/112: add additional tests that verify include-stopped * feature/112: implement include-stopped * feature/112: update readme and cli help * feature/112: fix linting issues * remove superfluous logging
This commit is contained in:
parent
1631c8cc2e
commit
e584f8bfcf
8 changed files with 101 additions and 33 deletions
|
|
@ -18,7 +18,11 @@ func NewMockAPIServer() *httptest.Server {
|
|||
logrus.Debug("Mock server has received a HTTP call on ", r.URL)
|
||||
var response = ""
|
||||
|
||||
if isRequestFor("containers/json?limit=0", r) {
|
||||
if isRequestFor("filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0", r) {
|
||||
response = getMockJSONFromDisk("./mocks/data/containers.json")
|
||||
} else if isRequestFor("filters=%7B%22status%22%3A%7B%22created%22%3Atrue%2C%22exited%22%3Atrue%2C%22running%22%3Atrue%7D%7D&limit=0", r) {
|
||||
response = getMockJSONFromDisk("./mocks/data/containers.json")
|
||||
} else if isRequestFor("containers/json?limit=0", r) {
|
||||
response = getMockJSONFromDisk("./mocks/data/containers.json")
|
||||
} else if isRequestFor("ae8964ba86c7cd7522cf84e09781343d88e0e3543281c747d88b27e246578b65", r) {
|
||||
response = getMockJSONFromDisk("./mocks/data/container_stopped.json")
|
||||
|
|
@ -48,4 +52,3 @@ func getMockJSONFromDisk(relPath string) string {
|
|||
}
|
||||
return string(buf)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"Labels": {
|
||||
"com.centurylinklabs.watchtower": "true"
|
||||
},
|
||||
"State": "exited",
|
||||
"State": "running",
|
||||
"Status": "Exited (1) 6 days ago",
|
||||
"HostConfig": {
|
||||
"NetworkMode": "default"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue