소스 검색

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
 	}