Skip to content

Commit

Permalink
[cherry-pick] Check create when fire the artifact event (#20838)
Browse files Browse the repository at this point in the history
Check create when fire the artifact event

  fixes #20828

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
  • Loading branch information
stonezdj authored Aug 12, 2024
1 parent 6095188 commit a0d4092
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 a0d4092

Please sign in to comment.