Skip to content

Commit 142a943

Browse files
2202985 Docker V2 task fails to push the container images after the task version updated to 2.243.0 (#401)
1 parent 9505899 commit 142a943

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

common-npm-packages/docker-common/dockercommandutils.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,20 @@ export function getImageFingerPrintV1Name(history: string): string {
221221
if (!history) {
222222
return null;
223223
}
224-
225224
const lines = history.split(/[\r?\n]/);
226225
if (lines && lines.length > 0) {
227-
v1Name = parseHistoryForV1Name(lines[0]);
226+
for (let i = 0; i < lines.length; i++) {
227+
if (lines[i].indexOf("layerId") >= 0) {
228+
v1Name = parseHistoryForV1Name(lines[i]);
229+
break
230+
}
231+
}
228232
}
229233

230234
return v1Name;
231235
}
232236

237+
233238
export function getImageSize(layers: { [key: string]: string }[]): string {
234239
let imageSize = 0;
235240
for (const layer of layers) {
@@ -346,6 +351,9 @@ export async function getHistory(connection: ContainerConnection, image: string)
346351
}
347352

348353
export async function getImageRootfsLayers(connection: ContainerConnection, imageDigest: string): Promise<string[]> {
354+
if (!imageDigest || imageDigest === "") {
355+
return []
356+
}
349357
var command = connection.createCommand();
350358
command.arg("inspect");
351359
command.arg(imageDigest);

common-npm-packages/docker-common/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-npm-packages/docker-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "azure-pipelines-tasks-docker-common",
3-
"version": "2.245.0",
3+
"version": "2.247.0",
44
"description": "Common Library for Azure Rest Calls",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)