mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 10:45:37 +00:00
[cherry-pick] Check create when fire the artifact event (#20842)
Check create when fire the artifact event fixes #20828 Signed-off-by: stonezdj <stone.zhang@broadcom.com>
This commit is contained in:
parent
a97373f25b
commit
0a8d259c2c
|
@ -164,16 +164,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