Skip to content

Commit 4137b81

Browse files
committed
#Fixed #27260 Use NewArtifactStoreWithEventCallback
1 parent 4d4c01c commit 4137b81

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libpod/runtime.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,15 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {
531531

532532
// Using sync once value to only init the store exactly once and only when it will be actually be used.
533533
runtime.ArtifactStore = sync.OnceValues(func() (*artStore.ArtifactStore, error) {
534-
return artStore.NewArtifactStore(filepath.Join(runtime.storageConfig.GraphRoot, "artifacts"), runtime.SystemContext())
534+
artifactEventCallBack := func(status, name, digest string, attributes map[string]string) {
535+
eventStatus, err := events.StringToStatus(status)
536+
if err != nil {
537+
logrus.Errorf("Unknown artifact event status %q: %v", status, err)
538+
return
539+
}
540+
runtime.NewArtifactEvent(eventStatus, name, digest, attributes)
541+
}
542+
return artStore.NewArtifactStoreWithEventCallback(filepath.Join(runtime.storageConfig.GraphRoot, "artifacts"), runtime.SystemContext(), artifactEventCallBack)
535543
})
536544
}
537545

0 commit comments

Comments
 (0)