mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 03:35:21 +01:00
Check create when fire the artifact event (#20832)
fixes #20828 Signed-off-by: stonezdj <stone.zhang@broadcom.com> Co-authored-by: Shengwen YU <yshengwen@vmware.com>
This commit is contained in:
parent
79886dfcce
commit
4ad86b300a
@ -173,7 +173,8 @@ func (c *controller) Ensure(ctx context.Context, repository, digest string, opti
|
||||
}
|
||||
}
|
||||
}
|
||||
// fire event
|
||||
if created {
|
||||
// fire event for create
|
||||
e := &metadata.PushArtifactEventMetadata{
|
||||
Ctx: ctx,
|
||||
Artifact: artifact,
|
||||
@ -183,6 +184,7 @@ func (c *controller) Ensure(ctx context.Context, repository, digest string, opti
|
||||
e.Tag = option.Tags[0]
|
||||
}
|
||||
notification.AddEvent(ctx, e)
|
||||
}
|
||||
return created, artifact.ID, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user