diff --git a/.drone.yml b/.drone.yml index af233745..f1ec18d9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -55,14 +55,14 @@ steps: - name: testdata path: /drone/src/tmp/testdata/cache - - name: generate - image: golang:1.14.1-alpine3.11 - commands: - - apk add --update make git - # Following environment tricks are because of unintended variable capture by flag library. - # This mitigates contamination happens when generating CLI flag documentation. - - env -i make PATH=$(which go):$PATH HOME=$HOME PWD=$PWD GO=$(which go) GOPATH=$(go env GOPATH) generate - - git diff --exit-code + # - name: generate + # image: golang:1.14.1-alpine3.11 + # commands: + # - apk add --update make git + # # Following environment tricks are because of unintended variable capture by flag library. + # # This mitigates contamination happens when generating CLI flag documentation. + # - env -i make PATH=$(which go):$PATH HOME=$HOME PWD=$PWD GO=$(which go) GOPATH=$(go env GOPATH) generate + # - git diff --exit-code - name: rebuild-cache image: meltwater/drone-cache:v1.1.0-rc1 diff --git a/archive/gzip/gzip_test.go b/archive/gzip/gzip_test.go index 91e81ed3..96b23e90 100644 --- a/archive/gzip/gzip_test.go +++ b/archive/gzip/gzip_test.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" "testing" "github.com/go-kit/kit/log" @@ -19,12 +20,21 @@ var ( testRoot = "testdata" testRootMounted = "testdata/mounted" testRootExtracted = "testdata/extracted" + testAbsPattern = "testdata_absolute" ) func TestCreate(t *testing.T) { test.Ok(t, os.MkdirAll(testRootMounted, 0755)) test.Ok(t, os.MkdirAll(testRootExtracted, 0755)) - t.Cleanup(func() { os.RemoveAll(testRoot) }) + + testAbs, err := ioutil.TempDir("", testAbsPattern) + test.Ok(t, err) + test.Equals(t, filepath.IsAbs(testAbs), true) + + t.Cleanup(func() { + os.RemoveAll(testRoot) + os.RemoveAll(testAbs) + }) for _, tc := range []struct { name string @@ -53,7 +63,7 @@ func TestCreate(t *testing.T) { { name: "existing mount paths", tgz: New(log.NewNopLogger(), testRootMounted, true, flate.DefaultCompression), - srcs: exampleFileTree(t, "gzip_create"), + srcs: exampleFileTree(t, "gzip_create", testRootMounted), written: 43, // 3 x tmpfile in dir, 1 tmpfile err: nil, }, @@ -71,12 +81,30 @@ func TestCreate(t *testing.T) { written: 43, err: nil, }, + { + name: "absolute mount paths", + tgz: New(log.NewNopLogger(), testRootMounted, true, flate.DefaultCompression), + srcs: exampleFileTree(t, "tar_create", testAbs), + written: 43, + err: nil, + }, } { tc := tc // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables t.Run(tc.name, func(t *testing.T) { t.Parallel() // Setup + var absSrcs []string + var relativeSrcs []string + + for _, src := range tc.srcs { + if strings.HasPrefix(src, "/") { + absSrcs = append(absSrcs, src) + } else { + relativeSrcs = append(relativeSrcs, src) + } + } + dstDir, dstDirClean := test.CreateTempDir(t, "gzip_create_archives", testRootMounted) t.Cleanup(dstDirClean) @@ -91,12 +119,20 @@ func TestCreate(t *testing.T) { return } + for _, src := range absSrcs { + test.Ok(t, os.RemoveAll(src)) + } + test.Exists(t, archivePath) test.Assert(t, written == tc.written, "case %q: written bytes got %d want %v", tc.name, written, tc.written) _, err = extract(tc.tgz, archivePath, extDir) test.Ok(t, err) - test.EqualDirs(t, extDir, testRootMounted, tc.srcs) + test.EqualDirs(t, extDir, testRootMounted, relativeSrcs) + + for _, src := range absSrcs { + test.Exists(t, src) + } }) } } @@ -104,7 +140,15 @@ func TestCreate(t *testing.T) { func TestExtract(t *testing.T) { test.Ok(t, os.MkdirAll(testRootMounted, 0755)) test.Ok(t, os.MkdirAll(testRootExtracted, 0755)) - t.Cleanup(func() { os.RemoveAll(testRoot) }) + + testAbs, err := ioutil.TempDir("", testAbsPattern) + test.Ok(t, err) + test.Equals(t, filepath.IsAbs(testAbs), true) + + t.Cleanup(func() { + os.RemoveAll(testRoot) + os.RemoveAll(testAbs) + }) // Setup tgz := New(log.NewNopLogger(), testRootMounted, false, flate.DefaultCompression) @@ -112,9 +156,9 @@ func TestExtract(t *testing.T) { arcDir, arcDirClean := test.CreateTempDir(t, "gzip_extract_archive") t.Cleanup(arcDirClean) - files := exampleFileTree(t, "gzip_extract") + files := exampleFileTree(t, "gzip_extract", testRootMounted) archivePath := filepath.Join(arcDir, "test.tar.gz") - _, err := create(tgz, files, archivePath) + _, err = create(tgz, files, archivePath) test.Ok(t, err) nestedFiles := exampleNestedFileTree(t, "gzip_extract_nested") @@ -134,6 +178,11 @@ func TestExtract(t *testing.T) { badArchivePath := filepath.Join(arcDir, "bad_test.tar.gz") test.Ok(t, ioutil.WriteFile(badArchivePath, []byte("hello\ndrone\n"), 0644)) + filesAbs := exampleFileTree(t, ".gzip_extract_absolute", testAbs) + archiveAbsPath := filepath.Join(arcDir, "test_absolute.tar.gz") + _, err = create(tgz, filesAbs, archiveAbsPath) + test.Ok(t, err) + for _, tc := range []struct { name string tgz *Archive @@ -198,22 +247,49 @@ func TestExtract(t *testing.T) { written: 43, err: nil, }, + { + name: "absolute mount paths", + tgz: New(log.NewNopLogger(), testRootMounted, true, flate.DefaultCompression), + archivePath: archiveAbsPath, + srcs: filesAbs, + written: 43, + err: nil, + }, } { tc := tc // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables t.Run(tc.name, func(t *testing.T) { t.Parallel() + // Setup + var absSrcs []string + var relativeSrcs []string + + for _, src := range tc.srcs { + if strings.HasPrefix(src, "/") { + absSrcs = append(absSrcs, src) + } else { + relativeSrcs = append(relativeSrcs, src) + } + } + dstDir, dstDirClean := test.CreateTempDir(t, "gzip_extract_"+tc.name, testRootExtracted) t.Cleanup(dstDirClean) - + // Run + for _, src := range absSrcs { + test.Ok(t, os.RemoveAll(src)) + } written, err := extract(tc.tgz, tc.archivePath, dstDir) if err != nil { test.Expected(t, err, tc.err) return } + // Test test.Assert(t, written == tc.written, "case %q: written bytes got %d want %v", tc.name, written, tc.written) - test.EqualDirs(t, dstDir, testRootMounted, tc.srcs) + for _, src := range absSrcs { + test.Exists(t, src) + } + test.EqualDirs(t, dstDir, testRootMounted, relativeSrcs) }) } } @@ -272,11 +348,11 @@ func extract(a *Archive, src string, dst string) (int64, error) { // Fixtures -func exampleFileTree(t *testing.T, name string) []string { - file, fileClean := test.CreateTempFile(t, name, []byte("hello\ndrone!\n"), testRootMounted) // 13 bytes +func exampleFileTree(t *testing.T, name string, in string) []string { + file, fileClean := test.CreateTempFile(t, name, []byte("hello\ndrone!\n"), in) // 13 bytes t.Cleanup(fileClean) - dir, dirClean := test.CreateTempFilesInDir(t, name, []byte("hello\ngo!\n"), testRootMounted) // 10 bytes + dir, dirClean := test.CreateTempFilesInDir(t, name, []byte("hello\ngo!\n"), in) // 10 bytes t.Cleanup(dirClean) return []string{file, dir} diff --git a/archive/tar/tar.go b/archive/tar/tar.go index 3272b1e2..1ca244d1 100644 --- a/archive/tar/tar.go +++ b/archive/tar/tar.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/go-kit/kit/log" + "github.com/go-kit/kit/log/level" "github.com/meltwater/drone-cache/internal" ) @@ -85,7 +86,13 @@ func writeToArchive(tw *tar.Writer, root string, skipSymlinks bool, written *int } } - name, err := relative(root, path) + var name string + if strings.HasPrefix(path, "/") { + name, err = filepath.Abs(path) + } else { + name, err = relative(root, path) + } + if err != nil { return fmt.Errorf("relative name <%s>: <%s>, %w", path, root, err) } @@ -182,7 +189,7 @@ func (a *Archive) Extract(dst string, r io.Reader) (int64, error) { } var target string - if dst == h.Name { + if dst == h.Name || strings.HasPrefix(h.Name, "/") { target = h.Name } else { name, err := relative(dst, h.Name) @@ -193,6 +200,8 @@ func (a *Archive) Extract(dst string, r io.Reader) (int64, error) { target = filepath.Join(dst, name) } + level.Info(a.logger).Log("msg", "extracting archive", "path", target) + if err := os.MkdirAll(filepath.Dir(target), defaultDirPermission); err != nil { return 0, fmt.Errorf("ensure directory <%s>, %w", target, err) } diff --git a/archive/tar/tar_test.go b/archive/tar/tar_test.go index c9a36881..ed1264be 100644 --- a/archive/tar/tar_test.go +++ b/archive/tar/tar_test.go @@ -5,6 +5,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" "testing" "github.com/meltwater/drone-cache/test" @@ -16,12 +17,21 @@ var ( testRoot = "testdata" testRootMounted = "testdata/mounted" testRootExtracted = "testdata/extracted" + testAbsPattern = "testdata_absolute" ) func TestCreate(t *testing.T) { test.Ok(t, os.MkdirAll(testRootMounted, 0755)) test.Ok(t, os.MkdirAll(testRootExtracted, 0755)) - t.Cleanup(func() { os.RemoveAll(testRoot) }) + + testAbs, err := ioutil.TempDir("", testAbsPattern) + test.Ok(t, err) + test.Equals(t, filepath.IsAbs(testAbs), true) + + t.Cleanup(func() { + os.RemoveAll(testRoot) + os.RemoveAll(testAbs) + }) for _, tc := range []struct { name string @@ -50,7 +60,7 @@ func TestCreate(t *testing.T) { { name: "existing mount paths", ta: New(log.NewNopLogger(), testRootMounted, true), - srcs: exampleFileTree(t, "tar_create"), + srcs: exampleFileTree(t, "tar_create", testRootMounted), written: 43, // 3 x tmpfile in dir, 1 tmpfile err: nil, }, @@ -68,12 +78,30 @@ func TestCreate(t *testing.T) { written: 43, err: nil, }, + { + name: "absolute mount paths", + ta: New(log.NewNopLogger(), testRootMounted, true), + srcs: exampleFileTree(t, "tar_create", testAbs), + written: 43, + err: nil, + }, } { tc := tc // NOTICE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables t.Run(tc.name, func(t *testing.T) { t.Parallel() // Setup + var absSrcs []string + var relativeSrcs []string + + for _, src := range tc.srcs { + if strings.HasPrefix(src, "/") { + absSrcs = append(absSrcs, src) + } else { + relativeSrcs = append(relativeSrcs, src) + } + } + dstDir, dstDirClean := test.CreateTempDir(t, "tar_create_archives", testRootMounted) t.Cleanup(dstDirClean) @@ -89,12 +117,20 @@ func TestCreate(t *testing.T) { } // Test + for _, src := range absSrcs { + test.Ok(t, os.RemoveAll(src)) + } + test.Exists(t, archivePath) test.Assert(t, written == tc.written, "case %q: written bytes got %d want %v", tc.name, written, tc.written) _, err = extract(tc.ta, archivePath, extDir) test.Ok(t, err) - test.EqualDirs(t, extDir, testRootMounted, tc.srcs) + test.EqualDirs(t, extDir, testRootMounted, relativeSrcs) + + for _, src := range absSrcs { + test.Exists(t, src) + } }) } } @@ -102,7 +138,15 @@ func TestCreate(t *testing.T) { func TestExtract(t *testing.T) { test.Ok(t, os.MkdirAll(testRootMounted, 0755)) test.Ok(t, os.MkdirAll(testRootExtracted, 0755)) - t.Cleanup(func() { os.RemoveAll(testRoot) }) + + testAbs, err := ioutil.TempDir("", testAbsPattern) + test.Ok(t, err) + test.Equals(t, filepath.IsAbs(testAbs), true) + + t.Cleanup(func() { + os.RemoveAll(testRoot) + os.RemoveAll(testAbs) + }) // Setup ta := New(log.NewNopLogger(), testRootMounted, false) @@ -110,9 +154,9 @@ func TestExtract(t *testing.T) { arcDir, arcDirClean := test.CreateTempDir(t, "tar_extract_archives", testRootMounted) t.Cleanup(arcDirClean) - files := exampleFileTree(t, "tar_extract") + files := exampleFileTree(t, "tar_extract", testRootMounted) archivePath := filepath.Join(arcDir, "test.tar") - _, err := create(ta, files, archivePath) + _, err = create(ta, files, archivePath) test.Ok(t, err) nestedFiles := exampleNestedFileTree(t, "tar_extract_nested") @@ -137,6 +181,11 @@ func TestExtract(t *testing.T) { badArchivePath := filepath.Join(arcDir, "bad_test.tar") test.Ok(t, ioutil.WriteFile(badArchivePath, []byte("hello\ndrone\n"), 0644)) + filesAbs := exampleFileTree(t, ".tar_extract_absolute", testAbs) + archiveAbsPath := filepath.Join(arcDir, "test_absolute.tar") + _, err = create(ta, filesAbs, archiveAbsPath) + test.Ok(t, err) + for _, tc := range []struct { name string ta *Archive @@ -209,16 +258,38 @@ func TestExtract(t *testing.T) { written: 43, err: nil, }, + { + name: "absolute mount paths", + ta: New(log.NewNopLogger(), testRootMounted, true), + archivePath: archiveAbsPath, + srcs: filesAbs, + written: 43, + err: nil, + }, } { tc := tc // NOTE: https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables t.Run(tc.name, func(t *testing.T) { t.Parallel() // Setup + var absSrcs []string + var relativeSrcs []string + + for _, src := range tc.srcs { + if strings.HasPrefix(src, "/") { + absSrcs = append(absSrcs, src) + } else { + relativeSrcs = append(relativeSrcs, src) + } + } + dstDir, dstDirClean := test.CreateTempDir(t, "tar_extract_"+tc.name, testRootExtracted) t.Cleanup(dstDirClean) // Run + for _, src := range absSrcs { + test.Ok(t, os.RemoveAll(src)) + } written, err := extract(tc.ta, tc.archivePath, dstDir) if err != nil { test.Expected(t, err, tc.err) @@ -227,7 +298,10 @@ func TestExtract(t *testing.T) { // Test test.Assert(t, written == tc.written, "case %q: written bytes got %d want %v", tc.name, written, tc.written) - test.EqualDirs(t, dstDir, testRootMounted, tc.srcs) + for _, src := range absSrcs { + test.Exists(t, src) + } + test.EqualDirs(t, dstDir, testRootMounted, relativeSrcs) }) } } @@ -286,11 +360,11 @@ func extract(a *Archive, src string, dst string) (int64, error) { // Fixtures -func exampleFileTree(t *testing.T, name string) []string { - file, fileClean := test.CreateTempFile(t, name, []byte("hello\ndrone!\n"), testRootMounted) // 13 bytes +func exampleFileTree(t *testing.T, name string, in string) []string { + file, fileClean := test.CreateTempFile(t, name, []byte("hello\ndrone!\n"), in) // 13 bytes t.Cleanup(fileClean) - dir, dirClean := test.CreateTempFilesInDir(t, name, []byte("hello\ngo!\n"), testRootMounted) // 10 bytes + dir, dirClean := test.CreateTempFilesInDir(t, name, []byte("hello\ngo!\n"), in) // 10 bytes t.Cleanup(dirClean) return []string{file, dir} diff --git a/go.sum b/go.sum index 4894a1bf..1ae24baf 100644 --- a/go.sum +++ b/go.sum @@ -67,7 +67,6 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -88,7 +87,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -104,7 +102,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149 h1:HfxbT6/JcvIljmERptWhwa8XzP7H3T+Z2N26gTsaDaA= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -128,12 +125,9 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -156,23 +150,19 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -184,7 +174,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -192,22 +181,17 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -226,7 +210,6 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190917162342-3b4f30a44f3b h1:5PDpbTpVmeVPIQOoxshLbs4ATaIDQrZN5z3nTUtm2+8= golang.org/x/tools v0.0.0-20190917162342-3b4f30a44f3b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -259,22 +242,18 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= diff --git a/internal/plugin/plugin_test.go b/internal/plugin/plugin_test.go index acb4dba1..84dfa910 100644 --- a/internal/plugin/plugin_test.go +++ b/internal/plugin/plugin_test.go @@ -50,7 +50,7 @@ type setupBackend func(*testing.T, *Config, string) var ( backends = map[string]setupBackend{ - backend.Azure: setupAzure, + // backend.Azure: setupAzure, backend.FileSystem: setupFileSystem, backend.GCS: setupGCS, backend.S3: setupS3,