Skip to content

Commit ef21e87

Browse files
committed
fix: add build tag and fix API compatibility for release/2.8
Signed-off-by: setoru <setoru127@gmail.com>
1 parent c935ca5 commit ef21e87

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

cmd/registry/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
_ "github.com/docker/distribution/registry/storage/driver/inmemory"
1515
_ "github.com/docker/distribution/registry/storage/driver/middleware/cloudfront"
1616
_ "github.com/docker/distribution/registry/storage/driver/middleware/redirect"
17+
_ "github.com/docker/distribution/registry/storage/driver/obs"
1718
_ "github.com/docker/distribution/registry/storage/driver/oss"
1819
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
1920
_ "github.com/docker/distribution/registry/storage/driver/swift"

registry/storage/driver/obs/doc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Package obs implements the Huawei OBS Storage driver backend. Support can be
2+
// enabled by including the "include_obs" build tag.
3+
package obs
4+

registry/storage/driver/obs/obs.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build include_obs
2+
// +build include_obs
3+
14
// Package obs provides a storagedriver.StorageDriver implementation to
25
// store blobs in HuaweiCloud storage.
36
//
@@ -702,9 +705,9 @@ func (d *driver) Delete(ctx context.Context, path string) error {
702705
for _, err := range output.Errors {
703706
errs = append(errs, errors.New(err.Message))
704707
}
705-
return storagedriver.Errors{
708+
return storagedriver.Error{
706709
DriverName: driverName,
707-
Errs: errs,
710+
Enclosed: errors.Join(errs...),
708711
}
709712
}
710713
}
@@ -1007,7 +1010,7 @@ func (w *writer) Size() int64 {
10071010
return w.size
10081011
}
10091012

1010-
func (w *writer) Cancel(ctx context.Context) error {
1013+
func (w *writer) Cancel() error {
10111014
if w.closed {
10121015
return fmt.Errorf("already closed")
10131016
} else if w.committed {

registry/storage/driver/obs/obs_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build include_obs
2+
// +build include_obs
3+
14
package obs
25

36
import (

0 commit comments

Comments
 (0)