kine / NVRAppDevOps

Navertica DevOps scripts for managing Microsoft Dynamics 365 Business Central Apps
31 stars 29 forks source link

Only download the docker image if the local image is outdated #23

Closed Sven-Niehus closed 4 years ago

Sven-Niehus commented 5 years ago

Add a new function to check if the local downloaded image is the latest available version.

If a new version is available download it, else use the already downloaded version

kine commented 4 years ago

@Sven-Niehus Hi Sven, have found issue in this functionality. Try to call e.g.: Get-ContainerImageCurrentness -ImageName bcinsider.azurecr.io/bconprem:cz

It is ignoring the fact that I am using non-default registry and is still looking into the default one.

This is output example:

PS > Get-ContainerImageCurrentness -ImageName bcinsider.azurecr.io/bconprem:cz
WARNING: The image mcr.microsoft.com/bcinsider.azurecr.io/bconprem:cz: could not be found locally
The local version of the image mcr.microsoft.com/bcinsider.azurecr.io/bconprem:cz: is NOT the latest version
Sven-Niehus commented 4 years ago

You need to specify the registry.

Example: Get-ContainerImageCurrentness -ImageName "businesscentral/sandbox" -ImageTag "ltsc2019" -Registry "mcr.microsoft.com"

kine commented 4 years ago

Ok, but in my case the image name includes this - bcinsider.azurecr.io/bconprem:cz. I expect that it will be parsed from there, because you are assigning it in this way, else I need to change your code to support bcinsider image, because right now it gives warning because the code is not working correctly.

kine commented 4 years ago

Ok, sorry, the call should be Get-ContainerImageCurrentness -Image bcinsider.azurecr.io/bconprem:cz

The result is>

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