mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Large amount of memory churn in etcd helper
This commit is contained in:
parent
b7ecbbf744
commit
caebe7300b
@ -44,7 +44,7 @@ func NewEtcdStorage(client tools.EtcdClient, codec runtime.Codec, prefix string)
|
|||||||
codec: codec,
|
codec: codec,
|
||||||
versioner: APIObjectVersioner{},
|
versioner: APIObjectVersioner{},
|
||||||
copier: api.Scheme,
|
copier: api.Scheme,
|
||||||
pathPrefix: prefix,
|
pathPrefix: path.Join("/", prefix),
|
||||||
cache: util.NewCache(maxEtcdCacheEntries),
|
cache: util.NewCache(maxEtcdCacheEntries),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -489,10 +489,10 @@ func (h *etcdHelper) GuaranteedUpdate(ctx context.Context, key string, ptrToType
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *etcdHelper) prefixEtcdKey(key string) string {
|
func (h *etcdHelper) prefixEtcdKey(key string) string {
|
||||||
if strings.HasPrefix(key, path.Join("/", h.pathPrefix)) {
|
if strings.HasPrefix(key, h.pathPrefix) {
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
return path.Join("/", h.pathPrefix, key)
|
return path.Join(h.pathPrefix, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
// etcdCache defines interface used for caching objects stored in etcd. Objects are keyed by
|
// etcdCache defines interface used for caching objects stored in etcd. Objects are keyed by
|
||||||
|
Loading…
Reference in New Issue
Block a user