revert change of artifact event (#21278)

fixes #20897
Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
Wang Yan 2024-12-04 14:11:55 +08:00 committed by GitHub
parent b72b5cec13
commit cdb0d2fc31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,18 +173,16 @@ func (c *controller) Ensure(ctx context.Context, repository, digest string, opti
}
}
}
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]
}
notification.AddEvent(ctx, e)
// fire event for create
e := &metadata.PushArtifactEventMetadata{
Ctx: ctx,
Artifact: artifact,
}
if option != nil && len(option.Tags) > 0 {
e.Tag = option.Tags[0]
}
notification.AddEvent(ctx, e)
return created, artifact.ID, nil
}