Skip to content

Commit 253b806

Browse files
committed
Fixed #27260 Add NewArtifactEvent in libpod/events.go
Signed-off-by: ByoungUk Lee <[email protected]>
1 parent 548cc01 commit 253b806

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

libpod/events.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@ func (r *Runtime) NewSecretEvent(status events.Status, secretID string) {
201201
}
202202
}
203203

204+
// NewArtifactEvent creates a new event for a libpod artifact
205+
func (r *Runtime) NewArtifactEvent(status events.Status, name, digest string, attr map[string]string){
206+
e := events.NewEvent(status)
207+
e.Type = events.Artifact
208+
e.Name = name
209+
e.ID = digest
210+
e.Attributes = attr
211+
if err := r.eventer.Write(e); err != nil {
212+
logrus.Errorf("Unable to write artifact event: %q", err)
213+
}
214+
}
215+
204216
// Events is a wrapper function for everyone to begin tailing the events log
205217
// with options
206218
func (r *Runtime) Events(ctx context.Context, options events.ReadOptions) error {

0 commit comments

Comments
 (0)