Skip to content

Commit 5840fa6

Browse files
committed
fix install for a package from MAR that may have different version than its normalized version
1 parent 50ebac2 commit 5840fa6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/code/InstallHelper.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,14 @@ private Hashtable BeginPackageInstall(
824824
pkgVersion += $"-{pkgToInstall.Prerelease}";
825825
}
826826
}
827+
828+
// For most repositories/providers the server will use the normalized version, which pkgVersion originally reflects
829+
// However, for container registries the version must exactly match what was in the artifact manifest and then reflected in PSResourceInfo.Version.ToString()
830+
if (currentServer.Repository.ApiVersion == PSRepositoryInfo.APIVersion.ContainerRegistry)
831+
{
832+
pkgVersion = pkgToInstall.Version.ToString();
833+
}
834+
827835
// Check to see if the pkg is already installed (ie the pkg is installed and the version satisfies the version range provided via param)
828836
if (!_reinstall)
829837
{

0 commit comments

Comments
 (0)