mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
Core panic fix when triggering a webhook of docker-registry replication
Signed-off-by: guanxiatao <guanxiatao@corp.netease.com>
This commit is contained in:
parent
119751e0fd
commit
e8655c667c
@ -201,6 +201,10 @@ func constructReplicationPayload(event *event.ReplicationEvent) (*model.Payload,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getMetadataFromResource(resource string) (namespace, nameAndTag string) {
|
func getMetadataFromResource(resource string) (namespace, nameAndTag string) {
|
||||||
|
// Usually resource format likes 'library/busybox:v1', but it could be 'busybox:v1' in docker registry
|
||||||
meta := strings.Split(resource, "/")
|
meta := strings.Split(resource, "/")
|
||||||
|
if len(meta) == 1 {
|
||||||
|
return "", meta[0]
|
||||||
|
}
|
||||||
return meta[0], meta[1]
|
return meta[0], meta[1]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user