forked from TrueCloudLab/distribution
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
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue