goharbor / harbor

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

Event based replication is not able to delete tag #21218

Open AharonIsraelCohen opened 3 days ago

AharonIsraelCohen commented 3 days ago

Overview: We are using replication with event based trigger, when creating new tag, the new tag is replicated, but when deleting tag there is a failed execution for "tag deletion" operation "Delete remote resources when locally deleted" checkbox is true .... The main problem is that when deleting the image itself, all the tags the harbor failed to delete in the remote will not be deleting when the image is deleted, only the other tags..

Expected behavior: When deleting tag from harbor image, the remote image tag in the registry will also be deleted.

Actual behavior: The tag is deleting from Habor but not from remote, and stay for good even after image deletion.

Steps to reproduce the problem:

  1. Push new image with some tag
  2. Add new tag called "test" on Harbor
  3. Check that the new "test" tag got replicated.
  4. Delete the new "test" tag from Harbor.
  5. Go to the replication executions event and you can see that it failed.
  6. Go to the remote registry and you will see that the "test" tag is still there.
  7. Delete the image from Harbor
  8. Go to the remote registry and you will see that the "test" tag is still there, and only the first tag got deleted.

Versions:

hazanmor commented 2 days ago

I am facing the same issue, with the following logs: `2024-11-20T16:40:03Z [INFO] [/controller/replication/transfer/image/transfer.go:139]: client for source registry [type: harbor, URL: http://harbor-core:80, insecure: true] created

2024-11-20T16:40:03Z [INFO] [/controller/replication/transfer/image/transfer.go:149]: client for destination registry [type: azure-acr, URL: https://managementacrglobal.azurecr.io, insecure: false] created

2024-11-20T16:40:03Z [ERROR] [/controller/replication/transfer/image/transfer.go:553]: failed to delete the tag fundguard/fg-gql-api-repo:release-394096 on the destination registry: the tag deletion isn't supported

2024-11-20T16:40:03Z [ERROR] [/jobservice/runner/redis.go:123]: Job 'REPLICATION:e3bcc815759edf57a9517fa4' exit with error: run error: the tag deletion isn't supported`