Skip to content

Commit

Permalink
Update cron and stow libraries (#485)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Jan 11, 2020
1 parent 7509961 commit 722f0b2
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 20 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ require (
github.com/json-iterator/go v1.1.8
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6
github.com/pkg/errors v0.8.1
github.com/robfig/cron/v3 v3.0.0
gomodules.xyz/stow v0.2.3
github.com/robfig/cron/v3 v3.0.1
gomodules.xyz/stow v0.2.4
gomodules.xyz/version v0.1.0
k8s.io/api v0.0.0-20191122220107-b5267f2975e0
k8s.io/apiextensions-apiserver v0.0.0-20191114105449-027877536833
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ github.com/robfig/cron v1.1.0 h1:jk4/Hud3TTdcrJgUOBgsqrZBarcxl6ADIjSC2iniwLY=
github.com/robfig/cron v1.1.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto=
github.com/russross/blackfriday v0.0.0-20170610170232-067529f716f4/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
Expand Down Expand Up @@ -691,6 +693,8 @@ gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0
gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU=
gomodules.xyz/stow v0.2.3 h1:019jXAX2+QsY5qCytwqpRRG+wZ7HaESZzsQ1vuhTV00=
gomodules.xyz/stow v0.2.3/go.mod h1:S9/zV1kNAWAvqmdum0oByA4+aNdTdoK9hKb1bObf1BI=
gomodules.xyz/stow v0.2.4 h1:TwsLIE8OAN3hkUR45CJwbJEoqYzWv33yuuq++ZkYdyo=
gomodules.xyz/stow v0.2.4/go.mod h1:aAgUEHyZ+4nKznyVupMMkP0JX9MXW1ZRrbRGaclp3E0=
gomodules.xyz/version v0.1.0 h1:inGItCg/egI0jPMeIE0SQkiDIJaodOMoCrxYqasQLR0=
gomodules.xyz/version v0.1.0/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
Expand Down
4 changes: 2 additions & 2 deletions vendor/github.com/robfig/cron/v3/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/robfig/cron/v3/chain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion vendor/github.com/robfig/cron/v3/cron.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 25 additions & 6 deletions vendor/github.com/robfig/cron/v3/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/robfig/cron/v3/option.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/gomodules.xyz/stow/azure/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

az "github.com/Azure/azure-sdk-for-go/storage"
"github.com/google/uuid"
"github.com/pkg/errors"
"gomodules.xyz/stow"
)
Expand Down Expand Up @@ -207,7 +208,7 @@ func cleanEtag(etag string) string {

func (c *container) HasWriteAccess() error {
r := bytes.NewReader([]byte("CheckBucketAccess"))
item, err := c.Put(".can_write", r, r.Size(), nil)
item, err := c.Put(".trash/"+uuid.New().String(), r, r.Size(), nil)
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions vendor/gomodules.xyz/stow/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927
github.com/dnaeon/go-vcr v1.0.1 // indirect
github.com/google/readahead v0.0.0-20161222183148-eaceba169032 // indirect
github.com/google/uuid v1.1.1
github.com/kr/pretty v0.1.0 // indirect
github.com/ncw/swift v1.0.49
github.com/pkg/errors v0.8.1
Expand Down
2 changes: 2 additions & 0 deletions vendor/gomodules.xyz/stow/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/readahead v0.0.0-20161222183148-eaceba169032 h1:6Be3nkuJFyRfCgr6qTIzmRp8y9QwDIbqy/nYr9WDPos=
github.com/google/readahead v0.0.0-20161222183148-eaceba169032/go.mod h1:qYysrqQXuV4tzsizt4oOQ6mrBZQ0xnQXP3ylXX8Jk5Y=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down
3 changes: 2 additions & 1 deletion vendor/gomodules.xyz/stow/s3/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/google/uuid"
"github.com/pkg/errors"
"gomodules.xyz/stow"
)
Expand Down Expand Up @@ -285,7 +286,7 @@ func parseMetadata(md map[string]*string) (map[string]interface{}, error) {
func (c *container) HasWriteAccess() error {
// TODO: Use https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETpolicy.html ?
r := bytes.NewReader([]byte("CheckBucketAccess"))
item, err := c.Put(".can_write", r, r.Size(), nil)
item, err := c.Put(".trash/"+uuid.New().String(), r, r.Size(), nil)
if err != nil {
return err
}
Expand Down
6 changes: 6 additions & 0 deletions vendor/gomodules.xyz/stow/s3/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ func (l *location) Containers(prefix, cursor string, count int) ([]stow.Containe
bucketRegion, err = s3manager.GetBucketRegionWithClient(ctx, l.client, *bucket.Name)
cancel()
if err != nil {
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" {
// sometimes buckets will still show up int eh ListBuckets results after
// being deleted, but will 404 when determining the region. Use this as a
// strong signal that the bucket has been deleted.
continue
}
return nil, "", errors.Wrapf(err, "Containers, getting bucket region for: %s", *bucket.Name)
}
if regionSet && region != "" && bucketRegion != region {
Expand Down
3 changes: 2 additions & 1 deletion vendor/gomodules.xyz/stow/swift/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package swift

import (
"errors"
"fmt"
"net/http"
"net/url"

Expand Down Expand Up @@ -109,7 +110,7 @@ func newSwiftClient(cfg stow.Config) (*swift.Connection, error) {
}
err := client.Authenticate()
if err != nil {
return nil, errors.New("Unable to authenticate")
return nil, fmt.Errorf("unable to authenticate, reason: %v", err)
}
return &client, nil
}
3 changes: 2 additions & 1 deletion vendor/gomodules.xyz/stow/swift/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"unicode/utf8"

"github.com/google/uuid"
"github.com/ncw/swift"
"github.com/pkg/errors"
"gomodules.xyz/stow"
Expand Down Expand Up @@ -166,7 +167,7 @@ func prepMetadata(md map[string]interface{}) (map[string]string, error) {

func (c *container) HasWriteAccess() error {
r := bytes.NewReader([]byte("CheckBucketAccess"))
item, err := c.Put(".can_write", r, r.Size(), nil)
item, err := c.Put(".trash/"+uuid.New().String(), r, r.Size(), nil)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ github.com/prometheus/procfs
github.com/prometheus/procfs/internal/util
github.com/prometheus/procfs/nfs
github.com/prometheus/procfs/xfs
# github.com/robfig/cron/v3 v3.0.0
# github.com/robfig/cron/v3 v3.0.1
github.com/robfig/cron/v3
# github.com/satori/go.uuid v1.2.0
github.com/satori/go.uuid
Expand Down Expand Up @@ -326,7 +326,7 @@ golang.org/x/text/width
golang.org/x/time/rate
# gomodules.xyz/jsonpatch/v2 v2.0.1
gomodules.xyz/jsonpatch/v2
# gomodules.xyz/stow v0.2.3
# gomodules.xyz/stow v0.2.4
gomodules.xyz/stow
gomodules.xyz/stow/azure
gomodules.xyz/stow/google
Expand Down

0 comments on commit 722f0b2

Please sign in to comment.