diff --git a/pkg/store/etcd.go b/pkg/store/etcd.go index 7b03bd8205..1f16052773 100644 --- a/pkg/store/etcd.go +++ b/pkg/store/etcd.go @@ -104,7 +104,7 @@ func (s *Etcd) Put(key string, value []byte) error { if etcdError, ok := err.(*etcd.EtcdError); ok { if etcdError.ErrorCode == 104 { // Not a directory // Remove the last element (the actual key) and set the prefix as a dir - err = s.createDirectory(getDirectory(key, false)) + err = s.createDirectory(getDirectory(key)) if _, err := s.client.Set(key, string(value), 0); err != nil { return err } diff --git a/pkg/store/helpers.go b/pkg/store/helpers.go index 99ba37eafd..a9386e31c1 100644 --- a/pkg/store/helpers.go +++ b/pkg/store/helpers.go @@ -24,7 +24,7 @@ func normalize(key string) string { // // /path/to/ // -func getDirectory(key string, omit bool) string { +func getDirectory(key string) string { parts := splitKey(key) parts = parts[:len(parts)-1] return "/" + join(parts)