Skip to content

Commit

Permalink
nydusify: fix deprecated
Browse files Browse the repository at this point in the history
1. replace `github.com/docker/distribution` with `github.com/distribution/reference`
2. replace `EndpointResolver` with `BaseEndpoint`

Signed-off-by: Yadong Ding <[email protected]>
  • Loading branch information
Desiki-high authored and imeoer committed Dec 4, 2023
1 parent 1159289 commit eeddfff
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion contrib/nydusify/cmd/nydusify.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"strings"

"github.com/containerd/containerd/reference/docker"
"github.com/docker/distribution/reference"
"github.com/distribution/reference"
"github.com/dustin/go-humanize"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down
3 changes: 1 addition & 2 deletions contrib/nydusify/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/aws/aws-sdk-go-v2/service/s3 v1.47.2
github.com/containerd/containerd v1.7.6
github.com/containerd/nydus-snapshotter v0.13.3
github.com/distribution/reference v0.5.0
github.com/docker/cli v24.0.7+incompatible
github.com/docker/distribution v2.8.3+incompatible
github.com/dustin/go-humanize v1.0.1
github.com/goharbor/acceleration-service v0.2.12
github.com/google/uuid v1.4.0
Expand Down Expand Up @@ -63,7 +63,6 @@ require (
github.com/containers/ocicrypt v1.1.7 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v23.0.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
Expand Down
2 changes: 0 additions & 2 deletions contrib/nydusify/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg=
github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/backend/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func newS3Backend(rawConfig []byte) (*S3Backend, error) {
}

client := s3.NewFromConfig(s3AWSConfig, func(o *s3.Options) {
o.EndpointResolver = s3.EndpointResolverFromURL(endpointWithScheme)
o.BaseEndpoint = &endpointWithScheme
o.Region = cfg.Region
o.UsePathStyle = true
if len(cfg.AccessKeySecret) > 0 && len(cfg.AccessKeyID) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/checker/rule/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"reflect"
"syscall"

"github.com/distribution/reference"
dockerconfig "github.com/docker/cli/cli/config"
"github.com/docker/distribution/reference"

"github.com/dragonflyoss/image-service/contrib/nydusify/pkg/checker/tool"
"github.com/dragonflyoss/image-service/contrib/nydusify/pkg/parser"
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/remotes"
"github.com/docker/distribution/reference"
"github.com/distribution/reference"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/tests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func testConvertWithS3Backend(t *testing.T, fsVersion string) {

// create bucket
s3Client := s3.NewFromConfig(aws.Config{}, func(o *s3.Options) {
o.EndpointResolver = s3.EndpointResolverFromURL("http://" + endpoint)
o.BaseEndpoint = aws.String("http://" + endpoint)
o.Region = region
o.UsePathStyle = true
o.Credentials = credentials.NewStaticCredentialsProvider(accessKey, accessSecret, "")
Expand Down

0 comments on commit eeddfff

Please sign in to comment.