Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swallow exceptions encountered in getHistory for DockerV2 task #10573

Merged
merged 4 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Tasks/Common/docker-common/dockercommandutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export function getCommandArguments(args: string): string {
export async function getLayers(connection: ContainerConnection, imageId: string): Promise<any> {
var layers = [];
var history = await getHistory(connection, imageId);
if (!history) {
return null;
}

var lines = history.split(/[\r?\n]/);

lines.forEach(line => {
Expand Down Expand Up @@ -178,8 +182,11 @@ async function getHistory(connection: ContainerConnection, image: string): Promi
});
}
catch (e) {
defer.reject(e);
console.log(e);
// Swallow any exceptions encountered in executing command
// such as --format flag not supported in old docker cli versions
output = null;
defer.resolve();
tl.warning(e);
dabasnidhi marked this conversation as resolved.
Show resolved Hide resolved
}

await defer.promise;
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerComposeV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerComposeV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "Simplified the task by:<br/>&nbsp;- Providing an option to simply select or type a command.<br/>&nbsp;- Retaining the useful input fields and providing an option to pass the rest as an argument to the command.",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down
4 changes: 4 additions & 0 deletions Tasks/DockerV2/dockerpush.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ async function publishToImageMetadataStore(connection: ContainerConnection, imag
const imageUri = getResourceName(imageName, digest);
const baseImageName = dockerFilePath ? getBaseImageNameFromDockerFile(dockerFilePath) : "NA";
const layers = await dockerCommandUtils.getLayers(connection, imageName);
if (!layers) {
return null;
}

const imageSize = dockerCommandUtils.getImageSize(layers);

// Getting pipeline variables
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "Simplified the task YAML by:<br/>&nbsp;- Removing the Container registry type input<br/>&nbsp;- Removing complex inputs as they can be passed as arguments to the command.",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DockerV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/KubernetesV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/KubernetesV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"preview": "false",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/KubernetesV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "What's new in Version 1.0:<br/>&nbsp;Added new service connection type input for easy selection of Azure AKS cluster.<br/>&nbsp;Replaced output variable input with output variables section that we had added in all tasks.",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/KubernetesV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 153,
"Patch": 3
"Minor": 154,
"Patch": 0
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down