Skip to content

Commit

Permalink
JENKINS-32792 - Added check for "sha256:" prefix in image ID
Browse files Browse the repository at this point in the history
  • Loading branch information
theartoflogic committed Feb 5, 2016
1 parent 9d994fa commit 8d947ca
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 8d947ca

Please sign in to comment.