-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
add repo and tag deletion event #2648
Conversation
whenever a tag is deleted an event is sent out via the regular notification channels Signed-off-by: Manish Tomar <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2648 +/- ##
==========================================
- Coverage 61.03% 51.31% -9.73%
==========================================
Files 132 129 -3
Lines 12122 11916 -206
==========================================
- Hits 7399 6115 -1284
- Misses 3803 5037 +1234
+ Partials 920 764 -156
Continue to review full report at Codecov.
|
@dmcgowan Can you please review this? This is required for Hub. I also need repo deletion event which is not possible cleanly because it doesn't go through |
LGTM This approach looks fine to me, maybe @stevvooe or @aaronlehmann can give it a quick look to see if the event looks consistent to them. |
Please sign your commits following these rules: $ git clone -b "tag-deleted-event" [email protected]:manishtomar/distribution.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354429072
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
by having another interface RepositoryRemover that is implemented by registry instance and is injected in app context for event tracking Signed-off-by: Manish Tomar <[email protected]>
b39f64b
to
328069b
Compare
forgot to commit this earlier Signed-off-by: Manish Tomar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is consistent with the other events.
Signed-off-by: Manish Tomar <[email protected]>
LGTM. @manishtomar why is Circle failing? |
Signed-off-by: Manish Tomar <[email protected]>
@dmp42 I fixed the circle failure but I don't know why Jenkins is failing with integration tests. The logs are not very clear. If you don't mind can you have a quick glance and let me know whats wrong? If not, I can try digging into it. |
LGTM |
context.App.repoRemover is single registry instance stored throughout app run. It was wrapped in another remover when processing each request. This remover happened to be remover got from previous request. This way every remover created was stored in infinite linked list causing memory leak. Fixing it by storing the wrapped remover inside the request context which will get gced when request context is gced. This was introduced in PR distribution#2648.
context.App.repoRemover is single registry instance stored throughout app run. It was wrapped in another remover when processing each request. This remover happened to be remover got from previous request. This way every remover created was stored in infinite linked list causing memory leak. Fixing it by storing the wrapped remover inside the request context which will get gced when request context is gced. This was introduced in PR distribution#2648. Signed-off-by: Manish Tomar <[email protected]>
fix memory leak introduced in PR #2648
context.App.repoRemover is single registry instance stored throughout app run. It was wrapped in another remover when processing each request. This remover happened to be remover got from previous request. This way every remover created was stored in infinite linked list causing memory leak. Fixing it by storing the wrapped remover inside the request context which will get gced when request context is gced. This was introduced in PR distribution#2648. Signed-off-by: Manish Tomar <[email protected]>
context.App.repoRemover is single registry instance stored throughout app run. It was wrapped in another remover when processing each request. This remover happened to be remover got from previous request. This way every remover created was stored in infinite linked list causing memory leak. Fixing it by storing the wrapped remover inside the request context which will get gced when request context is gced. This was introduced in PR distribution#2648. Signed-off-by: Manish Tomar <[email protected]>
Whenever a repo or tag is deleted an event is sent out via the regular notification channels. When repo is deleted the event will only contain repo name but not tag or digest. When tag is deleted the event it will have repo and tag but not digest. There is new interface
RepositoryRemover
containing method to delete the repo. Its implemented by internalregistry
instance. To capture the event the registry instance is also stored asRepositoryRemover
in the application context.