Skip to content

Commit

Permalink
2202985 Docker V2 task fails to push the container images after the t…
Browse files Browse the repository at this point in the history
…ask version updated to 2.243.0 (#401)
  • Loading branch information
PhilipsonJoseph authored Oct 7, 2024
1 parent 9505899 commit 142a943
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions common-npm-packages/docker-common/dockercommandutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,20 @@ export function getImageFingerPrintV1Name(history: string): string {
if (!history) {
return null;
}

const lines = history.split(/[\r?\n]/);
if (lines && lines.length > 0) {
v1Name = parseHistoryForV1Name(lines[0]);
for (let i = 0; i < lines.length; i++) {
if (lines[i].indexOf("layerId") >= 0) {
v1Name = parseHistoryForV1Name(lines[i]);
break
}
}
}

return v1Name;
}


export function getImageSize(layers: { [key: string]: string }[]): string {
let imageSize = 0;
for (const layer of layers) {
Expand Down Expand Up @@ -346,6 +351,9 @@ export async function getHistory(connection: ContainerConnection, image: string)
}

export async function getImageRootfsLayers(connection: ContainerConnection, imageDigest: string): Promise<string[]> {
if (!imageDigest || imageDigest === "") {
return []
}
var command = connection.createCommand();
command.arg("inspect");
command.arg(imageDigest);
Expand Down
4 changes: 2 additions & 2 deletions common-npm-packages/docker-common/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common-npm-packages/docker-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-tasks-docker-common",
"version": "2.245.0",
"version": "2.247.0",
"description": "Common Library for Azure Rest Calls",
"repository": {
"type": "git",
Expand Down

0 comments on commit 142a943

Please sign in to comment.