Skip to content
Permalink
Browse files

Merge pull request #46 from theartoflogic/master

[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 e53ebf8ff63509566ff242c960c5bbd8655618b3
@@ -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);
}

0 comments on commit e53ebf8

Please sign in to comment.
You can’t perform that action at this time.