contentproxy: ensure grpc stream is closed on commit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		| @@ -97,7 +97,14 @@ func (rw *remoteWriter) Write(p []byte) (n int, err error) { | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { | ||||
| func (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) (err error) { | ||||
| 	defer func() { | ||||
| 		err1 := rw.Close() | ||||
| 		if err == nil { | ||||
| 			err = err1 | ||||
| 		} | ||||
| 	}() | ||||
|  | ||||
| 	var base content.Info | ||||
| 	for _, opt := range opts { | ||||
| 		if err := opt(&base); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tonis Tiigi
					Tonis Tiigi