diff options
Diffstat (limited to 'src/k8splugin/internal/db/etcd_testing.go')
-rw-r--r-- | src/k8splugin/internal/db/etcd_testing.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/k8splugin/internal/db/etcd_testing.go b/src/k8splugin/internal/db/etcd_testing.go index 9dfcad82..4b4dfe3e 100644 --- a/src/k8splugin/internal/db/etcd_testing.go +++ b/src/k8splugin/internal/db/etcd_testing.go @@ -55,3 +55,12 @@ func (c *MockEtcdClient) Delete(key string) error { delete(c.Items, key) return c.Err } + +func (c *MockEtcdClient) DeletePrefix(key string) error { + for kvKey := range c.Items { + if strings.HasPrefix(kvKey, key) { + delete(c.Items, key) + } + } + return c.Err +} |