From 41b7b0e0dc1ee9b5554d3bf6b94c125ec922ead9 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 21 May 2019 11:08:55 -0700 Subject: [PATCH] Ensure namespaced writer commit has correct namespace The namespaced writer Commit method must always have a namespace in the context as checked by the removeIngestLease function, resulting in a panic when not provided. Signed-off-by: Derek McGowan --- metadata/content.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metadata/content.go b/metadata/content.go index 00f310f7b..a60f51ae9 100644 --- a/metadata/content.go +++ b/metadata/content.go @@ -567,6 +567,8 @@ func (nw *namespacedWriter) createAndCopy(ctx context.Context, desc ocispec.Desc } func (nw *namespacedWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { + ctx = namespaces.WithNamespace(ctx, nw.namespace) + nw.l.RLock() defer nw.l.RUnlock()