Skip to content

Commit

Permalink
Updated the logic of updating ImageName with ImageDigest (#10676)
Browse files Browse the repository at this point in the history
* Bug fix in logic of updating image digest

* removing comments

* Added missing mapping

* Update Update-DockerImageSettings.psm1

* Addressed review comments

* Addressed review comments
  • Loading branch information
vinodkumar3 committed Jun 25, 2019
1 parent d61a6fb commit 101173f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Expand Up @@ -43,6 +43,7 @@ function Update-DockerImageSettings
{
throw (Get-VstsLocString -Key InvalidImageDigestValue -ArgumentList @($imageDigestValue, $imageDigestsPath))
}
$imageDigestRepoNameWithRegistry = $imageDigestValue.Substring(0, $hashSeparatorIndex)
$imageDigestRepoName = $imageDigestValue.Substring($slashIndex + 1, $hashSeparatorIndex - $slashIndex - 1)

if ($imageNames -ne $null)
Expand All @@ -67,6 +68,10 @@ function Update-DockerImageSettings
{
throw (Get-VstsLocString -Key AmbiguousImages -ArgumentList @($imageName))
}

if($imageDigestRepoNameWithRegistry -ne $imageDigestRepoName ){
$imageNameToDigestMapping[$imageDigestRepoNameWithRegistry] = $imageDigestValue
}
}
$imageNameToDigestMapping[$imageName] = $imageDigestValue
}
Expand Down Expand Up @@ -117,4 +122,4 @@ function Update-DockerImageSettings
} finally {
Trace-VstsLeavingInvocation $MyInvocation
}
}
}
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricUpdateManifestsV2/task.json
Expand Up @@ -20,7 +20,7 @@
"version": {
"Major": 2,
"Minor": 4,
"Patch": 4
"Patch": 5
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "Update Service Fabric Manifests ($(updateType))",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricUpdateManifestsV2/task.loc.json
Expand Up @@ -20,7 +20,7 @@
"version": {
"Major": 2,
"Minor": 4,
"Patch": 4
"Patch": 5
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down

0 comments on commit 101173f

Please sign in to comment.