mirror of
https://github.com/distribution/distribution
synced 2024-11-06 19:35:52 +01: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:
parent
3f6bf09069
commit
d0bc83d8e4
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user