Problems after Harbor rollback

73 Views Asked by At

Harbor rollback. Updated Harbor, but after a while the work had to be rolled back. The database and settings of Harbor itself were rolled back, but the artifacts on the disk have changed in the meantime. Does Harbor remove artifacts from disk that are not in the database? Maybe there is a ready-made solution that will remove such artifacts from the disk?

While I'm trying to find with my script the artifacts that are on the disk, but there is no information about them in the database. Found 300+ such artifacts.

1

There are 1 best solutions below

0
Vad1mo On

When you roll back the DB to a previous state, the blobs in the object store become indivisible to harbor. All operations are based on the DB data.

What you need is a tool that can construct a delta between blobs/manifests in storage and DB.

I am not aware of such a tool.

As a workaround, I would spin up a second harbor cluster and then replicate all images from the old harbor to the new one.

After that is done, and you made sure the nesting of project and image names is correct you can perform a comparison between storage old and new.

If you are using s3 you can do a sync storage NEW → OLD with s3 it would be this aws s3 sync s3://new-bucket/ s3:/old-bucket --delete

Using the --delete option deletes files that exist in the destination but not in the source.