mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-11 06:04:11 +01:00
fix update pull time issue (#12601)
fixes #12574 let the tag ID as 0 when tags array is empty when to update pull time Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
parent
a2112bfa40
commit
588bf475ae
@ -67,7 +67,9 @@ func (a *Handler) updatePullTime(ctx context.Context, event *event.ArtifactEvent
|
||||
if err != nil {
|
||||
log.Infof("failed to list tags when to update pull time, %v", err)
|
||||
} else {
|
||||
tagID = tags[0].ID
|
||||
if len(tags) != 0 {
|
||||
tagID = tags[0].ID
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := artifact.Ctl.UpdatePullTime(ctx, event.Artifact.ID, tagID, time.Now()); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user