Include path and hashes in destroy hook input (#2102)

This commit is contained in:
WithoutPants
2021-12-13 14:38:00 +11:00
committed by GitHub
parent 9a8f05d826
commit 79e01589ca
6 changed files with 91 additions and 10 deletions

View File

@@ -310,7 +310,11 @@ func (r *mutationResolver) ImageDestroy(ctx context.Context, input models.ImageD
fileDeleter.Commit()
// call post hook after performing the other actions
r.hookExecutor.ExecutePostHooks(ctx, i.ID, plugin.ImageDestroyPost, input, nil)
r.hookExecutor.ExecutePostHooks(ctx, i.ID, plugin.ImageDestroyPost, plugin.ImageDestroyInput{
ImageDestroyInput: input,
Checksum: i.Checksum,
Path: i.Path,
}, nil)
return true, nil
}
@@ -358,7 +362,11 @@ func (r *mutationResolver) ImagesDestroy(ctx context.Context, input models.Image
for _, image := range images {
// call post hook after performing the other actions
r.hookExecutor.ExecutePostHooks(ctx, image.ID, plugin.ImageDestroyPost, input, nil)
r.hookExecutor.ExecutePostHooks(ctx, image.ID, plugin.ImageDestroyPost, plugin.ImagesDestroyInput{
ImagesDestroyInput: input,
Checksum: image.Checksum,
Path: image.Path,
}, nil)
}
return true, nil