Skip to content

Commit 58d5940

Browse files
authored
Lowercase ACR package name when pushing to server (#1552)
1 parent 6b4cf0a commit 58d5940

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/code/ACRServerAPICalls.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,8 @@ internal bool PushNupkgACR(string psd1OrPs1File, string outputNupkgDir, string p
11061106
{
11071107
errRecord = null;
11081108
// Push the nupkg to the appropriate repository
1109-
var fullNupkgFile = System.IO.Path.Combine(outputNupkgDir, pkgName + "." + pkgVersion.ToNormalizedString() + ".nupkg");
1110-
1109+
string fullNupkgFile = System.IO.Path.Combine(outputNupkgDir, pkgName + "." + pkgVersion.ToNormalizedString() + ".nupkg");
1110+
string pkgNameLower = pkgName.ToLower();
11111111
string accessToken = string.Empty;
11121112
string tenantID = string.Empty;
11131113

@@ -1136,7 +1136,8 @@ internal bool PushNupkgACR(string psd1OrPs1File, string outputNupkgDir, string p
11361136

11371137
/* Uploading .nupkg */
11381138
_cmdletPassedIn.WriteVerbose("Start uploading blob");
1139-
var moduleLocation = GetStartUploadBlobLocation(registry, pkgName, acrAccessToken).Result;
1139+
// Note: ACR registries will only accept a name that is all lowercase.
1140+
var moduleLocation = GetStartUploadBlobLocation(registry, pkgNameLower, acrAccessToken).Result;
11401141

11411142
_cmdletPassedIn.WriteVerbose("Computing digest for .nupkg file");
11421143
bool nupkgDigestCreated = CreateDigest(fullNupkgFile, out string nupkgDigest, out ErrorRecord nupkgDigestError);
@@ -1159,7 +1160,7 @@ internal bool PushNupkgACR(string psd1OrPs1File, string outputNupkgDir, string p
11591160
}
11601161
using (FileStream configStream = new FileStream(emptyFilePath, FileMode.Create)){ }
11611162
_cmdletPassedIn.WriteVerbose("Start uploading an empty file");
1162-
var emptyLocation = GetStartUploadBlobLocation(registry, pkgName, acrAccessToken).Result;
1163+
var emptyLocation = GetStartUploadBlobLocation(registry, pkgNameLower, acrAccessToken).Result;
11631164
_cmdletPassedIn.WriteVerbose("Computing digest for empty file");
11641165
bool emptyDigestCreated = CreateDigest(emptyFilePath, out string emptyDigest, out ErrorRecord emptyDigestError);
11651166
if (!emptyDigestCreated)
@@ -1200,7 +1201,7 @@ internal bool PushNupkgACR(string psd1OrPs1File, string outputNupkgDir, string p
12001201
File.WriteAllText(configFilePath, fileContent);
12011202

12021203
_cmdletPassedIn.WriteVerbose("Create the manifest layer");
1203-
bool manifestCreated = CreateManifest(registry, pkgName, pkgVersion.OriginalVersion, configFilePath, true, acrAccessToken).Result;
1204+
bool manifestCreated = CreateManifest(registry, pkgNameLower, pkgVersion.OriginalVersion, configFilePath, true, acrAccessToken).Result;
12041205

12051206
if (manifestCreated)
12061207
{

0 commit comments

Comments
 (0)