mirror of
https://github.com/distribution/distribution.git
synced 2025-08-31 22:48:01 +00:00
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:
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user