浏览代码

builder-next/patchImageConfig: nitpicks

1. Do not introduce another dt variable.

2. Wrap the error similar to all the others.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Kir Kolyshkin 6 年之前
父节点
当前提交
ac827a7fff
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      builder/builder-next/exporter/writer.go

+ 2 - 2
builder/builder-next/exporter/writer.go

@@ -78,9 +78,9 @@ func patchImageConfig(dt []byte, dps []digest.Digest, history []ocispec.History,
 	}
 
 	if cache != nil {
-		dt, err := json.Marshal(cache)
+		dt, err = json.Marshal(cache)
 		if err != nil {
-			return nil, err
+			return nil, errors.Wrap(err, "failed to marshal cache")
 		}
 		m["moby.buildkit.cache.v0"] = dt
 	}