Navcontainerhelper: Calling Get-BestGenericImageName fails with error - cannot convert 20200211 to version

Created on 8 Jul 2020  路  5Comments  路  Source: microsoft/navcontainerhelper

Describe the issue
Calling Get-BestGenericImageName in navcontainerhelper 0.7.0.12 fails with error

% : Cannot convert value "20200211" to type "System.Version". Error: "Version string portion was too short or too long."
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.12\ContainerHandling\Get-BestGenericImageName.ps1:28 char:72
+ ... ke $tag } | % { [System.Version]($_.SubString($tag.indexOf('*'), $_.l ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [ForEach-Object], RuntimeException
    + FullyQualifiedErrorId : InvalidCastParseTargetInvocation,Microsoft.PowerShell.Commands.ForEachObjectCommand`


Environment
NavContainerHelper is version 0.7.0.12
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 2004 (and tested also on Windows Server 2019 Version 1809)
Docker Client Version is 19.03.5
Docker Server Version is 19.03.5

Root cause seems to be an image tag 20200211-generic which is not filtered out.

Fix Ready

Most helpful comment

You are right, just published 0.7.0.13 with a fix for this really bad bug.

All 5 comments

You are right, just published 0.7.0.13 with a fix for this really bad bug.

Excellent. Tested and running.

The reason for this was, that I also created a new set of generic images - published those as -generic-dev - and a setting in containerhelper to set the generic image in use. So my build machine was using the -generic-dev images - where the old -generic didn't exist.
This ment that all containerhelper tests was passing and all was fine - IF you had the genericImageName setting set to the right value...:-(
That won't happen again.

Thanks Freddy for a very fast resolution!

Shipped in 0.7.0.13

Was this page helpful?
0 / 5 - 0 ratings