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

"How to identify the completion of image transmission with a specific tag within a webhook?" #19035

Closed
menglong21 opened this issue Jul 27, 2023 · 2 comments · Fixed by #19433

Comments

@menglong21
Copy link

Hi, I have configured the replication of an image with a specific tag between two Harbor instances. Is there any way to identify the completion of this image transmission and specifically recognize the name of the image tag within a webhook?
webhooks now:
{"type":"REPLICATION","occur_at":1690428883,"operator":"MANUAL","event_data":{"replication":{"harbor_hostname":"10.18.7.7","job_status":"Success","artifact_type":"artifact","authentication_type":"basic","override_mode":true,"trigger_type":"MANUAL","policy_creator":"admin","execution_timestamp":1690428878,"src_resource":{"registry_type":"harbor","endpoint":"http://10.18.7.7:5000","namespace":"test"},"dest_resource":{"registry_name":"总中心","registry_type":"harbor","endpoint":"https://10.18.7.1:5000","namespace":"test"},"successful_artifact":[{"type":"artifact","status":"Success","name_tag":"test10g [2 item(s) in total]"}]}}}

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@chlins
Copy link
Member

chlins commented Oct 10, 2023

Add a new field references into the webhook payload, which is a string list contains the tags or digests if no tag of the artifact, retain the old name_tag as summary info to not bring any break change.

e.g.

{
  "type": "REPLICATION",
  "occur_at": 1696924365,
  "operator": "admin",
  "event_data": {
    "replication": {
      "harbor_hostname": "192.168.8.107",
      "job_status": "Success",
      "artifact_type": "artifact",
      "authentication_type": "basic",
      "override_mode": true,
      "trigger_type": "MANUAL",
      "policy_creator": "admin",
      "execution_timestamp": 1696924334,
      "src_resource": {
        "registry_type": "harbor",
        "endpoint": "http://192.168.8.107",
        "namespace": "library"
      },
      "dest_resource": {
        "registry_name": "demo",
        "registry_type": "harbor",
        "endpoint": "https://demo.goharbor.io",
        "namespace": "library"
      },
      "successful_artifact": [
        {
          "type": "artifact",
          "status": "Success",
          "name_tag": "harbor-core [7 item(s) in total]",
          "references": [
            "v2.7.1-dev",
            "v2.6.0",
            "v2.5.3",
            "sha256:ceb3af5a41675524ab9e05ced7c879f1f5296eaaaae65b761a06feab2b819ce4",
            "sha256:1c0efb866fba0d4377e0dc8d449c7c2b51c075c5e109be984ea545b6e44729e2",
            "sha256:d96bd7f1d0d02f90449293d314b4a4f5edc0de1db84cc7ff125b5cfa48ab3e0b",
            "sha256:5a909af45c03907a5392ced76b4b7d255937b55e5330410b9b1a9608bf39865d"
          ]
        }
      ]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants