Skip to content

Commit a3f044b

Browse files
2202985 Docker V2 task fails to push the container images after the task version updated to 2.243.0 (#373)
1 parent 74ccf2a commit a3f044b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,17 @@ function parseHistoryForLayers(input: string) {
301301

302302
function parseHistoryForV1Name(topHistoryLayer: string): string {
303303
let v1Name = "";
304-
const layerIdString = "layerId:sha256:";
305-
const indexOfLayerId = topHistoryLayer.indexOf(layerIdString);
304+
let layerIdString = "layerId:sha256:";
305+
let indexOfLayerId = topHistoryLayer.indexOf(layerIdString);
306+
if (indexOfLayerId < 0) {
307+
layerIdString = "layerId:"
308+
indexOfLayerId = topHistoryLayer.indexOf(layerIdString);
309+
}
306310
if (indexOfLayerId >= 0) {
307311
v1Name = topHistoryLayer.substring(indexOfLayerId + layerIdString.length);
308312
}
309313

310-
return v1Name;
314+
return v1Name && v1Name !== "<missing>" ? v1Name : "";
311315
}
312316

313317
export async function getHistory(connection: ContainerConnection, image: string): Promise<string> {

0 commit comments

Comments
 (0)