Skip to content

Add Tarsum Calculation during v2 Pull operation - #9

Merged
dmp42 merged 1 commit into
dmcgowan:v2-registryfrom
jlhawn:v2-registry
Dec 23, 2014
Merged

dmp42 merged 1 commit into
dmcgowan:v2-registryfrom
jlhawn:v2-registry

Conversation

@jlhawn

@jlhawn jlhawn commented Dec 23, 2014

Copy link
Copy Markdown

While the v2 pull operation is writing the body of the layer blob to disk
it now computes the tarsum checksum of the archive before extracting it to
the backend storage driver. If the checksum does not match that from the
image manifest an error is raised.

Also adds more debug logging to the pull operation and fixes existing test
cases which were failing.

Docker-DCO-1.1-Signed-off-by: Josh Hawn [email protected] (github: jlhawn)

While the v2 pull operation is writing the body of the layer blob to disk
it now computes the tarsum checksum of the archive before extracting it to
the backend storage driver. If the checksum does not match that from the
image manifest an error is raised.

Also adds more debug logging to the pull operation and fixes existing test
cases which were failing.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
@jlhawn

jlhawn commented Dec 23, 2014

Copy link
Copy Markdown
Author

It passes the tests! I checked.

@dmp42

dmp42 commented Dec 23, 2014

Copy link
Copy Markdown

Comment thread pkg/tarsum/tarsum.go

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't splitN force it to be 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er, I think it's at most 2, per the docs:

n > 0: at most n substrings; the last substring will be the unsplit remainder.

@jessfraz

Copy link
Copy Markdown

lgtm

Comment thread pkg/tarsum/tarsum.go

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I am into this being a single function. I don't have a better suggestion at this time, so you can disregard my comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added this to the tarsum package because there currently isn't a reverse lookup constructor >_>

@stevvooe

Copy link
Copy Markdown
Collaborator

LGTM!

@dmp42

dmp42 commented Dec 23, 2014

Copy link
Copy Markdown

LGTM

@dmp42
dmp42 merged this pull request into dmcgowan:v2-registry Dec 23, 2014
@jlhawn
jlhawn deleted the v2-registry branch July 31, 2015 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants