Skip to content

Commit 5260124

Browse files
committed
reverting tolowercase change
1 parent 43f4cf2 commit 5260124

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

Tasks/Docker/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"loc.input.label.context": "Build Context",
2424
"loc.input.help.context": "Path to the build context.",
2525
"loc.input.label.imageName": "Image Name",
26-
"loc.input.help.imageName": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names.",
26+
"loc.input.help.imageName": "Name of the Docker image to build, push or run.",
2727
"loc.input.label.qualifyImageName": "Qualify Image Name",
2828
"loc.input.help.qualifyImageName": "Qualify the image name with the Docker registry connection's hostname if not otherwise specified.",
2929
"loc.input.label.additionalImageTags": "Additional Image Tags",

Tasks/Docker/containerbuild.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@ function findDockerFile(dockerfilepath : string) : string {
2727
}
2828
}
2929

30-
function changeImageNameToLowerCase(imageName: string): string {
31-
var imageNameArray = imageName.split(":");
32-
33-
if(imageNameArray.length > 0)
34-
{
35-
imageName = imageNameArray[0].toLowerCase() + ":" + imageNameArray.slice(1).join(":");
36-
}
37-
38-
return imageName;
39-
}
40-
4130
export function run(connection: ContainerConnection): any {
4231
var command = connection.createCommand();
4332
command.arg("build");
@@ -56,7 +45,7 @@ export function run(connection: ContainerConnection): any {
5645
});
5746

5847
var imageName = tl.getInput("imageName", true);
59-
imageName = changeImageNameToLowerCase(imageName);
48+
imageName = imageUtils.changeDefaultImageNameToLowerCase(imageName);
6049
var qualifyImageName = tl.getBoolInput("qualifyImageName");
6150
if (qualifyImageName) {
6251
imageName = connection.qualifyImageName(imageName);

Tasks/Docker/containerimageutils.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
import * as tl from "vsts-task-lib/task";
23

34
export function hasRegistryComponent(imageName: string): boolean {
45
var periodIndex = imageName.indexOf("."),
@@ -18,3 +19,20 @@ export function imageNameWithoutTag(imageName: string): string {
1819
endIndex = imageName.indexOf(":", endIndex);
1920
return endIndex < 0 ? imageName : imageName.substr(0, endIndex);
2021
}
22+
23+
export function changeDefaultImageNameToLowerCase(imageName: string): string {
24+
25+
if(imageName === getDefaultImage())
26+
{
27+
return imageName.toLowerCase();
28+
}
29+
30+
return imageName;
31+
}
32+
33+
function getDefaultImage() : string {
34+
var repositoryName = tl.getVariable('build.repository.name');
35+
var buildId = tl.getVariable('build.buildId');
36+
37+
return repositoryName + ":" + buildId;
38+
}

Tasks/Docker/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"defaultValue": "$(Build.Repository.Name):$(Build.BuildId)",
116116
"required": true,
117117
"visibleRule": "action = Build an image || action = Push an image || action = Run an image",
118-
"helpMarkDown": "Name of the Docker image to build, push or run. The name will be converted to lowercase as Docker supports only lowercase for image names."
118+
"helpMarkDown": "Name of the Docker image to build, push or run."
119119
},
120120
{
121121
"name": "qualifyImageName",

0 commit comments

Comments
 (0)