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: Logging of delete by tag and copying descriptors #108

Merged
merged 1 commit into from
May 28, 2024

Conversation

sudo-bmitch
Copy link
Contributor

Fixes issue

Debug logging of a tag deletion does not show the tag annotation.

Describe the change

The descriptor was not copied, resulting in the deletion from the index overwriting the descriptor that was being logged. This fixes the Index.GetDesc call to always return a copy, and it fixes the copy to clone the annotations. This also improves the testing around GC.

How to verify it

go run ./cmd/olareg serve --port 5002 --store-type mem -v debug --gc-frequency 2m --gc-grace-period 5m --api-delete --gc-untagged &
regctl image copy localhost:5000/regclient/regctl:alpine localhost:5002/regclient/regctl:alpine
regctl tag rm localhost:5002/regclient/regctl:alpine
# view the logs of the deleted descriptor

Changelog text

  • Fix: Logging of delete by tag and copying descriptors

Please verify and check that the pull request fulfills the following requirements

  • Tests have been added or not applicable
  • Documentation has been added, updated, or not applicable
  • Changes have been rebased to main
  • Multiple commits to the same code have been squashed

This also improves the testing around GC.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
@sudo-bmitch sudo-bmitch merged commit 0f285cf into olareg:main May 28, 2024
4 checks passed
@sudo-bmitch sudo-bmitch deleted the pr-gc-testing branch May 28, 2024 20:50
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

1 participant