diff --git a/src/controller/artifact/controller.go b/src/controller/artifact/controller.go index 0a2888262..4bcea401f 100644 --- a/src/controller/artifact/controller.go +++ b/src/controller/artifact/controller.go @@ -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 }