daemon: ImageService.LogImageEvent: pass through context

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-12-02 13:45:05 +01:00
parent 1b1192f009
commit ee1a15a970
21 changed files with 32 additions and 33 deletions

View File

@@ -13,14 +13,12 @@ import (
// When no tag is given, buildkit doesn't call the image service so it has no
// way of knowing the image was created.
func (daemon *Daemon) ImageExportedByBuildkit(ctx context.Context, id string, desc ocispec.Descriptor) {
daemon.imageService.LogImageEvent(id, id, events.ActionCreate)
daemon.imageService.LogImageEvent(ctx, id, id, events.ActionCreate)
}
// ImageNamedByBuildkit is a callback that is called when an image is tagged by buildkit.
// Note: It is only called if the buildkit didn't call the image service itself to perform the tagging.
// Currently this only happens when the containerd image store is used.
func (daemon *Daemon) ImageNamedByBuildkit(ctx context.Context, ref reference.NamedTagged, desc ocispec.Descriptor) {
id := desc.Digest.String()
name := reference.FamiliarString(ref)
daemon.imageService.LogImageEvent(id, name, events.ActionTag)
daemon.imageService.LogImageEvent(ctx, desc.Digest.String(), reference.FamiliarString(ref), events.ActionTag)
}