Skip to content

Commit

Permalink
Merge pull request #46 from theartoflogic/master
Browse files Browse the repository at this point in the history
[FIXED JENKINS-32792] Added check for "sha256:" prefix in image ID
  • Loading branch information
oleg-nenashev committed Feb 8, 2016
2 parents 9d994fa + 8d947ca commit e53ebf8
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -61,6 +61,12 @@ private DockerFingerprints() {} // no instantiation
* @throws IllegalArgumentException Invalid ID
*/
public static @Nonnull String getFingerprintHash(@Nonnull String id) {

// Remove the "sha256:" prefix, if it exists
if (id.indexOf("sha256:") == 0) {
id = id.substring(7);
}

if (id.length() != 64) {
throw new IllegalArgumentException("Expecting 64-char full image ID, but got " + id);
}
Expand Down

0 comments on commit e53ebf8

Please sign in to comment.