Skip to content

Commit

Permalink
backend/manta: Update manta dependencies
Browse files Browse the repository at this point in the history
Internally, triton-go has changed how it handles errors. We can now get rid of
checking strings for errors, and we have introduced an errors library that
wraps some of the major errors we encounter and test for
  • Loading branch information
stack72 authored and apparentlymart committed Jan 17, 2018
1 parent 0e93e0c commit e9476c6
Show file tree
Hide file tree
Showing 27 changed files with 632 additions and 369 deletions.
3 changes: 2 additions & 1 deletion backend/remote-state/manta/backend_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 12,7 @@ import (
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/terraform/state/remote"
"github.com/hashicorp/terraform/terraform"
tritonErrors "github.com/joyent/triton-go/errors"
"github.com/joyent/triton-go/storage"
)

Expand All @@ -22,7 23,7 @@ func (b *Backend) States() ([]string, error) {
DirectoryName: path.Join(mantaDefaultRootStore, b.path),
})
if err != nil {
if strings.Contains(err.Error(), "ResourceNotFound") {
if tritonErrors.IsResourceNotFound(err) {
return result, nil
}
return nil, err
Expand Down
7 changes: 3 additions & 4 deletions backend/remote-state/manta/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 9,10 @@ import (
"log"
"path"

"strings"

uuid "github.com/hashicorp/go-uuid"
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/terraform/state/remote"
tritonErrors "github.com/joyent/triton-go/errors"
"github.com/joyent/triton-go/storage"
)

Expand All @@ -34,7 33,7 @@ func (c *RemoteClient) Get() (*remote.Payload, error) {
ObjectPath: path.Join(mantaDefaultRootStore, c.directoryName, c.keyName),
})
if err != nil {
if strings.Contains(err.Error(), "ResourceNotFound") {
if tritonErrors.IsResourceNotFound(err) {
return nil, nil
}
return nil, err
Expand Down Expand Up @@ -107,7 106,7 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) {
lockErr := &state.LockError{}
lockInfo, err := c.getLockInfo()
if err != nil {
if !strings.Contains(err.Error(), "ResourceNotFound") {
if tritonErrors.IsResourceNotFound(err) {
lockErr.Err = fmt.Errorf("failed to retrieve lock info: %s", err)
return "", lockErr
}
Expand Down
6 changes: 6 additions & 0 deletions vendor/github.com/joyent/triton-go/CHANGELOG.md

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

5 changes: 2 additions & 3 deletions vendor/github.com/joyent/triton-go/GNUmakefile

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

14 changes: 4 additions & 10 deletions vendor/github.com/joyent/triton-go/Gopkg.lock

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

10 changes: 3 additions & 7 deletions vendor/github.com/joyent/triton-go/Gopkg.toml

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

8 changes: 8 additions & 0 deletions vendor/github.com/joyent/triton-go/authentication/dummy.go

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

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

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

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

10 changes: 9 additions & 1 deletion vendor/github.com/joyent/triton-go/authentication/signature.go

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

8 changes: 8 additions & 0 deletions vendor/github.com/joyent/triton-go/authentication/signer.go

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

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

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

Loading

0 comments on commit e9476c6

Please sign in to comment.