Skip to content
Permalink
Browse files

JENKINS-32792 - Added check for "sha256:" prefix in image ID

  • Loading branch information...
theartoflogic committed Feb 5, 2016
1 parent 9d994fa commit 8d947ca5e2203fb43d92cf6ddb6b9464a153da50
@@ -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 8d947ca

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