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 <fmissi@redhat.com>
This commit is contained in:
Flavian Missi 2023-05-22 15:54:35 +02:00
parent 3f6bf09069
commit d0bc83d8e4
2 changed files with 2 additions and 2 deletions

View file

@ -372,7 +372,7 @@ type writer struct {
} }
// Cancel removes any written content from this FileWriter. // Cancel removes any written content from this FileWriter.
func (w *writer) Cancel() error { func (w *writer) Cancel(ctx context.Context) error {
w.closed = true w.closed = true
err := storageDeleteObject(cloud.NewContext(dummyProjectID, w.client), w.bucket, w.name) err := storageDeleteObject(cloud.NewContext(dummyProjectID, w.client), w.bucket, w.name)
if err != nil { if err != nil {

View file

@ -657,7 +657,7 @@ func (w *writer) Close() error {
return w.flushPart() return w.flushPart()
} }
func (w *writer) Cancel() error { func (w *writer) Cancel(ctx context.Context) error {
if w.closed { if w.closed {
return fmt.Errorf("already closed") return fmt.Errorf("already closed")
} else if w.committed { } else if w.committed {