mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-15 14:40:13 +01:00
Add support for whitelist of monitored containers
This commit is contained in:
parent
d6321bf8dc
commit
b0910ee20b
5 changed files with 60 additions and 9 deletions
|
|
@ -9,6 +9,30 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestContainerFilter_StraightMatch(t *testing.T) {
|
||||
c := newTestContainer("foo", []string{})
|
||||
f := containerFilter([]string{"foo"})
|
||||
assert.True(t, f(c))
|
||||
}
|
||||
|
||||
func TestContainerFilter_SlashMatch(t *testing.T) {
|
||||
c := newTestContainer("/foo", []string{})
|
||||
f := containerFilter([]string{"foo"})
|
||||
assert.True(t, f(c))
|
||||
}
|
||||
|
||||
func TestContainerFilter_NoMatch(t *testing.T) {
|
||||
c := newTestContainer("/bar", []string{})
|
||||
f := containerFilter([]string{"foo"})
|
||||
assert.False(t, f(c))
|
||||
}
|
||||
|
||||
func TestContainerFilter_NoFilters(t *testing.T) {
|
||||
c := newTestContainer("/bar", []string{})
|
||||
f := containerFilter([]string{})
|
||||
assert.True(t, f(c))
|
||||
}
|
||||
|
||||
func TestCheckDependencies(t *testing.T) {
|
||||
cs := []container.Container{
|
||||
newTestContainer("1", []string{}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue