mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Check create when fire the artifact event (#20832)
fixes #20828 Signed-off-by: stonezdj <stone.zhang@broadcom.com> Co-authored-by: Shengwen YU <yshengwen@vmware.com>
This commit is contained in:
parent
79886dfcce
commit
4ad86b300a
@ -173,16 +173,18 @@ func (c *controller) Ensure(ctx context.Context, repository, digest string, opti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fire event
|
if created {
|
||||||
e := &metadata.PushArtifactEventMetadata{
|
// fire event for create
|
||||||
Ctx: ctx,
|
e := &metadata.PushArtifactEventMetadata{
|
||||||
Artifact: artifact,
|
Ctx: ctx,
|
||||||
}
|
Artifact: artifact,
|
||||||
|
}
|
||||||
|
|
||||||
if option != nil && len(option.Tags) > 0 {
|
if option != nil && len(option.Tags) > 0 {
|
||||||
e.Tag = option.Tags[0]
|
e.Tag = option.Tags[0]
|
||||||
|
}
|
||||||
|
notification.AddEvent(ctx, e)
|
||||||
}
|
}
|
||||||
notification.AddEvent(ctx, e)
|
|
||||||
return created, artifact.ID, nil
|
return created, artifact.ID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user