From d0bc83d8e4e95ea891a5a085318053f148fa9b15 Mon Sep 17 00:00:00 2001 From: Flavian Missi Date: Mon, 22 May 2023 15:54:35 +0200 Subject: [PATCH] registry/storage/driver: receive context on Cancel methods both oss and gcs driver were missing the context parameter that is required to satisfy the storagedriver.FileWriter interface. Signed-off-by: Flavian Missi --- registry/storage/driver/gcs/gcs.go | 2 +- registry/storage/driver/oss/oss.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/storage/driver/gcs/gcs.go b/registry/storage/driver/gcs/gcs.go index 161fdf84d..f2b6f49ad 100644 --- a/registry/storage/driver/gcs/gcs.go +++ b/registry/storage/driver/gcs/gcs.go @@ -372,7 +372,7 @@ type writer struct { } // Cancel removes any written content from this FileWriter. -func (w *writer) Cancel() error { +func (w *writer) Cancel(ctx context.Context) error { w.closed = true err := storageDeleteObject(cloud.NewContext(dummyProjectID, w.client), w.bucket, w.name) if err != nil { diff --git a/registry/storage/driver/oss/oss.go b/registry/storage/driver/oss/oss.go index 0c5f76f0f..6d42af956 100644 --- a/registry/storage/driver/oss/oss.go +++ b/registry/storage/driver/oss/oss.go @@ -657,7 +657,7 @@ func (w *writer) Close() error { return w.flushPart() } -func (w *writer) Cancel() error { +func (w *writer) Cancel(ctx context.Context) error { if w.closed { return fmt.Errorf("already closed") } else if w.committed {