mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +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,16 +173,18 @@ func (c *controller) Ensure(ctx context.Context, repository, digest string, opti
|
||||
}
|
||||
}
|
||||
}
|
||||
// fire event
|
||||
e := &metadata.PushArtifactEventMetadata{
|
||||
Ctx: ctx,
|
||||
Artifact: artifact,
|
||||
}
|
||||
if created {
|
||||
// fire event for create
|
||||
e := &metadata.PushArtifactEventMetadata{
|
||||
Ctx: ctx,
|
||||
Artifact: artifact,
|
||||
}
|
||||
|
||||
if option != nil && len(option.Tags) > 0 {
|
||||
e.Tag = option.Tags[0]
|
||||
if option != nil && len(option.Tags) > 0 {
|
||||
e.Tag = option.Tags[0]
|
||||
}
|
||||
notification.AddEvent(ctx, e)
|
||||
}
|
||||
notification.AddEvent(ctx, e)
|
||||
return created, artifact.ID, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user