Skip to content

Conversation

@letFunny
Copy link
Collaborator

@letFunny letFunny commented Dec 5, 2024

  • Have you signed the CLA?

Hard links can now be extracted and they are correctly reflected in the manifest.

zhijie-yang and others added 2 commits December 5, 2024 11:23
Hard links can now be extracted and they are correctly reflected in the manifest.

---------

Co-authored-by: Rafid Bin Mostofa <rafid.mostofa@canonical.com>
Co-authored-by: Alberto Carretero <angelalbertoc.r@gmail.com>
@cjdcordeiro cjdcordeiro requested a review from niemeyer December 5, 2024 10:50
@cjdcordeiro cjdcordeiro added the Priority Look at me first label Dec 5, 2024
Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks, Alberto. This is looking great.

A few comments, and maybe the last pass:


// sanitizeTarPath removes the leading "./" from the source path in the tarball,
// and verifies that the path is not empty.
func sanitizeTarPath(path string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any logic that prevents the tar from leaving the target directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, we don't at the moment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed offline to do it, just not in this PR.

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks! A few more trivials, mainly just follow ups of the previous points.

LGTM.

}
}
sort.Strings(errs)
return fmt.Errorf("%s", errs[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

Per comment in the prior review, we don't need to append all the errors to then return the first one. We can simply stop on the first thing we find and return the error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem with that is that the error won't be deterministic, right? Maybe we can sort the links instead of the error if that is more performant.

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks!

@niemeyer niemeyer merged commit 9d9d214 into canonical:main Jan 10, 2025
14 checks passed
@letFunny letFunny deleted the hardlinks branch January 21, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority Look at me first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants