kine/NVRAppDevOps

Insider image is giving warning that the image was not found locally

Closed this issue · 11 comments

kine commented

After PR #23 you can get warning like

Get-ContainerImageCurrentness -Image bcinsider.azurecr.io/bconprem:cz

WARNING: The image mcr.microsoft.com/bconprem:cz could not be found locally
The local version of the image mcr.microsoft.com/bconprem:cz is NOT the latest version

because the function Get-ContainerImageCurrentness is taking the Image but is not parsing the registry correctly from the Image.

kine commented

@Sven-Niehus I have opened this issue to track the fix for the registry name parsing in the function Get-ContainerImageCurrentness. Please, give me info if you will fix that or I should fix that myself. Thanks!

kine commented

Ok, have fixed that in v0.9.89, commit 40abe8c

I've added a PR with the fix. You can now specify the FullName.
Example: Get-ContainerImageCurrentness -FullName "mcr.microsoft.com/businesscentral/sandbox:ltsc2019"

kine commented

Ok, than, what is difference between FullName and Image parameter?

The difference is that the FullName is Registry + Image.

In my example the image (including the tag) would be businesscentral/sandbox:ltsc2019 and the registry would be mcr.microsoft.com

kine commented

Interesting, because the regex you are using to parse the value is working for mcr.microsoft.com/businesscentral/sandbox:ltsc2019 but not for businesscentral/sandbox:ltsc2019

kine commented

I have just added condition to not parse the Registry name from the Image param when the Registry param is entered from outside (removed the default value and put it only in case that it is needed and not entered from outside).

It means it should now work as original version and if Registry name is included in the Image parameter, it will use it. If it is in Registry parameter, than this value will be used instead.

kine commented

@Sven-Niehus will this variant works for your usage?

You're right, my fault.

The only difference in the code is that Image uses the pre configured registry and FullName parses the registry from the URL. I fixed it in my newest commit in PR #26

You can now always specify the full Image name including everything. In my opinion that makes more sense because you nearly always have all the information needed.
I only included the other options for checking images on the fly, but that feature is not necessary anymore in my opinion.

kine commented

Should be solved by PR #26