Skip to content

Commit

Permalink
Latest Generic is wrong (#3722)
Browse files Browse the repository at this point in the history
Latest Generic is wrong when developing BcContainerHelper (i.e.
LatestGenericVersion.txt contains 0.0.0.0)

---------

Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk authored Oct 15, 2024
1 parent 88b0849 commit abda51e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
9 changes: 9 additions & 0 deletions BcContainerHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,12 @@ if ($isWindows) {
. (Join-Path $PSScriptRoot "PackageHandling\Publish-BuildOutputToStorage.ps1")
. (Join-Path $PSScriptRoot "PackageHandling\Get-AzureFeedWildcardVersion.ps1")
. (Join-Path $PSScriptRoot "PackageHandling\Install-AzDevops.ps1")

# In Development mode only
if ($LatestGenericTagVersion -eq '0.0.0.0') {
$labels = Get-BcContainerImageLabels -imageName 'mcr.microsoft.com/businesscentral:ltsc2022'
if ($labels) {
$LatestGenericTagVersion = $labels.tag
Write-Host "LatestGenericTagVersion is $LatestGenericTagVersion"
}
}
6 changes: 0 additions & 6 deletions ContainerHandling/Get-BestGenericImageName.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ function Get-BestGenericImageName {
$telemetryScope = InitTelemetryScope -name $MyInvocation.InvocationName -parameterValues $PSBoundParameters -includeParameters @()
try {

if ($LatestGenericTagVersion -eq '0.0.0.0') {
$labels = Get-BcContainerImageLabels -imageName 'mcr.microsoft.com/businesscentral:ltsc2022'
Write-Host "Setting LatestGenericTagVersion to $($labels.tag)"
$LatestGenericTagVersion = $labels.tag
}

if ($hostOsVersion -eq $null) {
$os = (Get-CimInstance Win32_OperatingSystem)
if ($os.OSType -ne 18 -or !$os.Version.StartsWith("10.0.")) {
Expand Down
2 changes: 1 addition & 1 deletion ContainerHandling/New-NavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ try {
if ($artifactUrl) {
$genericTagVersion = [Version](Get-BcContainerGenericTag -containerOrImageName $imageName)
if ($genericTagVersion -lt [Version]$LatestGenericTagVersion) {
Write-Host "Generic image is version $genericTagVersion - pulling a newer image"
Write-Host "Existing generic image is version $genericTagVersion - pulling a newer image"
$pullit = $true
}
}
Expand Down
2 changes: 1 addition & 1 deletion Saas/Download-BcEnvironmentInstalledExtensionToFolder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Download-BcEnvironmentInstalledExtensionToFolder {
[Parameter(Mandatory = $true)]
[string] $appName,
[Parameter(Mandatory = $true)]
[string] $appVersion = '0.0.0.0',
[string] $appVersion,
[Parameter(Mandatory = $false)]
[string] $appId
)
Expand Down

0 comments on commit abda51e

Please sign in to comment.