Skip to content

Commit

Permalink
Check create when fire the artifact event (#20832)
Browse files Browse the repository at this point in the history
fixes #20828

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Co-authored-by: Shengwen YU <yshengwen@vmware.com>
  • Loading branch information
stonezdj and Shengwen YU authored Aug 12, 2024
1 parent 79886df commit 4ad86b3
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/controller/artifact/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 4ad86b3

Please sign in to comment.