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

fix: prevent layer overwrites in image resulting in BLOB_UNKNOWN error #35

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Nov 20, 2024

This is most likely a bug in https://github.com/google/go-containerregistry, but we can work around it in Kaniko. In fact, the only bug in go-containerregistry may be that this behavior is allowed.

// Images in google/go-containerregistry don't support adding unique layers
// with duplicate diff IDs. For example, if the source image has an empty
// layer which has been compressed with Gzip level 3, and the layer we're
// adding is also an empty layer compressed with Gzip level 1, the diff IDs
// would match but the layer blobs would be different. This would cause an
// error when trying to upload the image to a registry as the manifest is
// referencing a blob that has been "overwritten".

Refs coder/envbuilder#385
Closes #34

@mafredri mafredri self-assigned this Nov 20, 2024
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

🎉

@mafredri mafredri merged commit 131d609 into main Nov 20, 2024
9 checks passed
@mafredri mafredri deleted the mafredri/fix-overwritten-layers branch November 20, 2024 13:21
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.

3 participants