goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.13k stars 4.66k forks source link

When we delete an artifact, will the data associated with it also be deleted? #20700

Open yexia553 opened 2 weeks ago

yexia553 commented 2 weeks ago

Dear harbor team,

I want to get help from you that, if we delete an artifact(docker image), will the data associated with it also be deleted? for example, the vulnerability data, audit logs.

looking forward to your reply. thank you

wy65701436 commented 1 week ago

To understand this question clearly and correctly, you can go through the source code of artifact controller.

Generally, some data with be removed align with the deletion of an artifact, and others are removed by garbage collection.

yexia553 commented 1 week ago

Hi @wy65701436 and @chlins , thank you for your suggestion, I am a new comer of golang and harbor source code, but I will dive into that and make it out. currently, we got some issue when we upgrade harbor from 2.7.x to 2.8.x and 2.9.x, we have more the 330000000 rows in the report_vulnerability_record table, and it always cause DB migration failed, we want to do some data clean work to reduce rows of this DB table, could you help give us some suggestion for that ?

Best Regards Thanks