mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 21:50:05 +00:00
FakeEtcdClient should return KeyNotFound on Delete
This commit is contained in:
@@ -283,7 +283,13 @@ func (f *FakeEtcdClient) Delete(key string, recursive bool) (*etcd.Response, err
|
||||
|
||||
f.Mutex.Lock()
|
||||
defer f.Mutex.Unlock()
|
||||
existing := f.Data[key]
|
||||
existing, ok := f.Data[key]
|
||||
if !ok {
|
||||
return &etcd.Response{}, &etcd.EtcdError{
|
||||
ErrorCode: EtcdErrorCodeNotFound,
|
||||
Index: f.ChangeIndex,
|
||||
}
|
||||
}
|
||||
index := f.generateIndex()
|
||||
f.Data[key] = EtcdResponseWithError{
|
||||
R: &etcd.Response{},
|
||||
|
Reference in New Issue
Block a user