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

contenthash: make all paths strings when converting #4904

Merged
merged 1 commit into from
May 7, 2024

Conversation

cyphar
Copy link
Contributor

@cyphar cyphar commented May 7, 2024

(This is a smaller patch split off from #4896 which should be trivial to review and allow me to get CI runs without needing approval each time I push a fixed version.)


Using []byte for paths is just begging for a mistake to be made, so update the signature of convert{PathToKey,KeyToPath} so that only keys are []byte and paths are always strings.

Signed-off-by: Aleksa Sarai cyphar@cyphar.com

Using []byte for paths is just begging for a mistake to be made, so
update the signature of convert{PathToKey,KeyToPath} so that only keys
are []byte and paths are always strings.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
@cyphar cyphar force-pushed the contenthash-cleanup-keypath-helpers branch from e583697 to c9dac11 Compare May 7, 2024 07:34
@cyphar
Copy link
Contributor Author

cyphar commented May 7, 2024

Converted with gofmt -w -r "string(convertKeyToPath(x)) -> convertKeyToPath(x)" -r "convertPathToKey([]byte(x)) -> convertPathToKey(x)" cache/contenthash/checksum.go, with a few follow-up type-related fixes.

@jedevc jedevc merged commit 7210b08 into moby:master May 7, 2024
73 checks passed
@jedevc
Copy link
Member

jedevc commented May 7, 2024

Cheers @cyphar, much appreciated 😆

@cyphar cyphar deleted the contenthash-cleanup-keypath-helpers branch May 7, 2024 15:07
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.

None yet

2 participants