Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix panic for unpack test #123

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

imeoer
Copy link
Collaborator

@imeoer imeoer commented Aug 3, 2022

Throws a panic like below when run TestUnpack test case:

converter_test.go:415:
Error Trace:	converter_test.go:415
Error:      	Not equal:
              expected: "sha256:b4679f7afa21a5513d84ba7d9a6faf2621f101421c830648512cd63475118fa1"
              actual  : "sha256:92ad2fb1075eabd299daa2dbb5e822031c198551fa9cebf29046ed79efa27ce3"

              Diff:
              --- Expected
              +++ Actual
              @@ -1,2 +1,2 @@
              -(digest.Digest) (len=71) "sha256:b4679f7afa21a5513d84ba7d9a6faf2621f101421c830648512cd63475118fa1"
              +(digest.Digest) (len=71) "sha256:92ad2fb1075eabd299daa2dbb5e822031c198551fa9cebf29046ed79efa27ce3"

Test:       	TestUnpack

Related: dragonflyoss/nydus#630

To make the unpacked tar consistent with the OCI-formatted tar before the pack,
we need to backfill the username and groupname in the tar header, which may
break the repeatable build when unpacking in different hosts, but actually has
little effect.

Signed-off-by: Yan Song [email protected]

Throws a panic like below when run TestUnpack test case:

```
converter_test.go:415:
Error Trace:	converter_test.go:415
Error:      	Not equal:
              expected: "sha256:b4679f7afa21a5513d84ba7d9a6faf2621f101421c830648512cd63475118fa1"
              actual  : "sha256:92ad2fb1075eabd299daa2dbb5e822031c198551fa9cebf29046ed79efa27ce3"

              Diff:
              --- Expected
              +++ Actual
              @@ -1,2 +1,2 @@
              -(digest.Digest) (len=71) "sha256:b4679f7afa21a5513d84ba7d9a6faf2621f101421c830648512cd63475118fa1"
              +(digest.Digest) (len=71) "sha256:92ad2fb1075eabd299daa2dbb5e822031c198551fa9cebf29046ed79efa27ce3"

Test:       	TestUnpack
```

Related: dragonflyoss/nydus#630

To make the unpacked tar consistent with the OCI-formatted tar before the pack,
we need to backfill the username and groupname in the tar header, which may
break the repeatable build when unpacking in different hosts, but actually has
little effect.

Signed-off-by: Yan Song <[email protected]>
@imeoer imeoer requested a review from changweige August 3, 2022 11:21
@changweige changweige merged commit 92d4e57 into containerd:main Aug 3, 2022
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.

2 participants