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

Remove workaround from 2.1.1 for faulty 2.1.0 manifest links #3365

Merged
merged 1 commit into from Oct 19, 2022

Conversation

brackendawson
Copy link
Contributor

@brackendawson brackendawson commented Feb 15, 2021

This reverts commit 06a098c (pull request: #864)

This changes the function of linkedBlobStatter.Clear(). It was either removing the first of two possible manifest links or returning nil if none were found. Now it once again it removes only the valid manifest link or returns an error if none are found.

This adresses #3122

Signed-off-by: Bracken Dawson abdawson@gmail.com

@thaJeztah
Copy link
Member

Originally added in #892 - I see some tickets linking to that PR (which may be worth checking to see if there's still a valid reason to keep the patch, or at least may require an entry in the change-log).

From #3122 (comment)

I checked and we never ran 2.1.0. I now also have strong doubts that any existing registries ever ran that version.

Let me /cc @milosgajdos for visibility (I see there's an internal Docker Hub pull request linked to #892)

@brackendawson
Copy link
Contributor Author

I would put in a change log note in regardless, something to the effect of "Tags which were pushed to distribution 2.1.0 which have not been overwritten by subsequent versions will not be accessible."

I'm not sure how distribution tracks the change log?

@thaJeztah
Copy link
Member

I applied the impact/changelog label, which should be looked at when preparing a release 👍

Copy link
Member

@deleteriousEffect deleteriousEffect left a comment

Choose a reason for hiding this comment

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

Maybe a little bit of a nitpick, but the TestLinkPathFuncs test here https://github.com/distribution/distribution/blob/main/registry/storage/manifeststore_test.go#L548 now makes even more sense to be in registry/storage/linkedblobstore_test.go corresponding to the file in which the link path functions are defined.

@brackendawson
Copy link
Contributor Author

Maybe a little bit of a nitpick, but the TestLinkPathFuncs test here https://github.com/distribution/distribution/blob/main/registry/storage/manifeststore_test.go#L548 now makes even more sense to be in registry/storage/linkedblobstore_test.go corresponding to the file in which the link path functions are defined.

Good spot, definitely agree that test should live in linkedblobstore_test.go. Is it worth burying those lines' git history under an "I moved this" commit and using this PR, currently only a revert, to do it?

@deleteriousEffect
Copy link
Member

Maybe a little bit of a nitpick, but the TestLinkPathFuncs test here https://github.com/distribution/distribution/blob/main/registry/storage/manifeststore_test.go#L548 now makes even more sense to be in registry/storage/linkedblobstore_test.go corresponding to the file in which the link path functions are defined.

Good spot, definitely agree that test should live in linkedblobstore_test.go. Is it worth burying those lines' git history under an "I moved this" commit and using this PR, currently only a revert, to do it?

Good point and probably not. I'll make a separate PR to move that.

@milosgajdos
Copy link
Member

Sorry, been busy. From the first look of it, this looks nice. I'd like to go over this properly again hopefully by the end of this week or the weekend at the latest. Thanks for your patience!

@brackendawson
Copy link
Contributor Author

@milosgajdos sorry to ping, but can we consider this for the upcoming 2.7.2 release?

We want the change because it makes the UX a little better for users who mistakenly use the config digest in place of the manifest digest, 404 rather than 500. We see users do this pretty frequently.

@milosgajdos
Copy link
Member

Thanks for the ping @brackendawson :) The delay in release is my bad, indeed.
The release prep has got stuck on a few PRs and never recovered given my getting swamped by work.

It's back on the agenda for the next CNCF call thanks to @joaodrp, so I'm hoping to restart the efforts and finally getting it over the finish line soon. I need to refresh my memory about this PR first, though.

@deleteriousEffect
Copy link
Member

@milosgajdos @thaJeztah Looks like buildx is pushing up an OCI Image Index with layers under the manifests array: docker/buildx#173 (comment)

Merging this issue would cause the validation step for manifests list to fail, since the existence check currently falls back to the _layers directory if it cannot find a digest in the manifest revisions.

We've recently had some trouble with these manifests ourselves at GitLab: https://gitlab.com/gitlab-org/container-registry/-/issues/404

Ideally, this step should fail since these manifests are invalid according to the OCI Image Index Spec, but this behavior has been allowed to happen for some time now.

CC: @joaodrp

@milosgajdos
Copy link
Member

@brackendawson can you rebase so we can rekick the build?

This reverts commit 06a098c

This changes the function of linkedBlobStatter.Clear(). It was either removing the first of two possible manifest links or returning nil if none were found. Now it once again it removes only the valid manifest link or returns an error if none are found.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
@brackendawson
Copy link
Contributor Author

@milosgajdos done

@aaronlehmann
Copy link
Contributor

@milosgajdos: Can this one move forward? I ran into the issue this is fixing and the current behavior seems very incorrect.

@milosgajdos milosgajdos merged commit fb21888 into distribution:main Oct 19, 2022
@milosgajdos
Copy link
Member

milosgajdos commented Oct 19, 2022

Sorry for the delay everyone! Thanks for the PR @brackendawson

@brackendawson brackendawson deleted the 3122-remove-workaround branch October 19, 2022 08:57
dylanrhysscott pushed a commit to digitalocean/docker-distribution that referenced this pull request Jan 5, 2023
This file is specifically not published to the
site anyway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants