Skip to content

Commit 4b00a51

Browse files
authored
Updated the logic of updating ImageName with ImageDigest (#10676) (#10748)
* Bug fix in logic of updating image digest * removing comments * Added missing mapping * Update Update-DockerImageSettings.psm1 * Addressed review comments * Addressed review comments
1 parent 147d2bd commit 4b00a51

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Tasks/ServiceFabricUpdateManifestsV2/Update-DockerImageSettings.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function Update-DockerImageSettings
4343
{
4444
throw (Get-VstsLocString -Key InvalidImageDigestValue -ArgumentList @($imageDigestValue, $imageDigestsPath))
4545
}
46+
$imageDigestRepoNameWithRegistry = $imageDigestValue.Substring(0, $hashSeparatorIndex)
4647
$imageDigestRepoName = $imageDigestValue.Substring($slashIndex + 1, $hashSeparatorIndex - $slashIndex - 1)
4748

4849
if ($imageNames -ne $null)
@@ -67,6 +68,10 @@ function Update-DockerImageSettings
6768
{
6869
throw (Get-VstsLocString -Key AmbiguousImages -ArgumentList @($imageName))
6970
}
71+
72+
if($imageDigestRepoNameWithRegistry -ne $imageDigestRepoName ){
73+
$imageNameToDigestMapping[$imageDigestRepoNameWithRegistry] = $imageDigestValue
74+
}
7075
}
7176
$imageNameToDigestMapping[$imageName] = $imageDigestValue
7277
}
@@ -117,4 +122,4 @@ function Update-DockerImageSettings
117122
} finally {
118123
Trace-VstsLeavingInvocation $MyInvocation
119124
}
120-
}
125+
}

Tasks/ServiceFabricUpdateManifestsV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"version": {
2121
"Major": 2,
2222
"Minor": 4,
23-
"Patch": 4
23+
"Patch": 5
2424
},
2525
"minimumAgentVersion": "1.95.0",
2626
"instanceNameFormat": "Update Service Fabric Manifests ($(updateType))",

Tasks/ServiceFabricUpdateManifestsV2/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"version": {
2121
"Major": 2,
2222
"Minor": 4,
23-
"Patch": 4
23+
"Patch": 5
2424
},
2525
"minimumAgentVersion": "1.95.0",
2626
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",

0 commit comments

Comments
 (0)