Skip to content

Commit

Permalink
Fix Repository returned error message (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
suaas21 authored and tamalsaha committed Nov 8, 2019
1 parent 5a9e035 commit decea34
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ unit-tests: $(BUILD_DIRS) bin/.container-$(DOTFILE_IMAGE)-TEST
#
# NB: -t is used to catch ctrl-c interrupt from keyboard and -t will be problematic for CI.

GINKGO_ARGS ?=
GINKGO_ARGS ?= "--flakeAttempts=2"
TEST_ARGS ?=

.PHONY: e2e-tests
Expand Down Expand Up @@ -428,7 +428,7 @@ e2e-tests: $(BUILD_DIRS)

.PHONY: e2e-parallel
e2e-parallel:
@$(MAKE) e2e-tests GINKGO_ARGS="-p -stream" --no-print-directory
@$(MAKE) e2e-tests GINKGO_ARGS="$(GINKGO_ARGS) -p -stream" --no-print-directory

ADDTL_LINTERS := goconst,gofmt,goimports,unparam

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ require (
kmodules.xyz/client-go v0.0.0-20191101042247-ee9566c9ac7f
kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045
kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3
kmodules.xyz/objectstore-api v0.0.0-20191106100235-bea39a8e0874
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c
kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6 h1:JEerfubBfd98TetzNFn
kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY=
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 h1:DuvD64ouPDbv3egAUUCy5rBqs/vc218DeVVivcqfa+U=
kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8=
kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3 h1:64QSexLk/Dio4+L8Ge1tb4c44aBiwmUwTNP2kCu6YQU=
kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8=
kmodules.xyz/objectstore-api v0.0.0-20191106100235-bea39a8e0874 h1:vtdcykMB/hIjvPihIjtZj5tyyCy6dd2v2Gf/XFyedN0=
kmodules.xyz/objectstore-api v0.0.0-20191106100235-bea39a8e0874/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8=
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c h1:y54FqF02HNs2d4eJh6w+7Q2sfVLORzvZd/ueGm/t7Fg=
kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c/go.mod h1:AzvHBjJvhFwUEiWrEKfdsgoqt5Ulio44Beo1vPoq7ww=
kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1 h1:NmVj5+kPpUgoxRans2XZt5SXm9cVy8E3b4yHaeVzqak=
Expand Down
3 changes: 2 additions & 1 deletion pkg/restic/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package restic

import (
"encoding/json"
"errors"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -368,7 +369,7 @@ func (w *ResticWrapper) run(commands ...Command) ([]byte, error) {
func formatError(err error, stdErr string) error {
parts := strings.Split(strings.TrimSuffix(stdErr, "\n"), "\n")
if len(parts) > 1 {
return fmt.Errorf("%s, reason: %s", err, parts[len(parts)-1:][0])
return errors.New(strings.Join(parts[1:], " "))
}
return err
}
Expand Down
6 changes: 6 additions & 0 deletions vendor/kmodules.xyz/objectstore-api/api/v1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func (backend Backend) Container() (string, error) {
return backend.Azure.Container, nil
} else if backend.Swift != nil {
return backend.Swift.Container, nil
} else if backend.B2 != nil {
return backend.B2.Bucket, nil
} else if backend.Rest != nil {
u, err := url.Parse(backend.Rest.URL)
if err != nil {
Expand All @@ -51,6 +53,8 @@ func (backend Backend) Location() (string, error) {
return "local:" + backend.Local.MountPath, nil
} else if backend.Swift != nil {
return "swift:" + backend.Swift.Container, nil
} else if backend.B2 != nil {
return "b2:" + backend.B2.Bucket, nil
}
return "", errors.New("no storage provider is configured")
}
Expand Down Expand Up @@ -79,6 +83,8 @@ func (backend Backend) Prefix() (string, error) {
return backend.GCS.Prefix, nil
} else if backend.Azure != nil {
return backend.Azure.Prefix, nil
} else if backend.B2 != nil {
return backend.B2.Prefix, nil
} else if backend.Swift != nil {
return backend.Swift.Prefix, nil
} else if backend.Rest != nil {
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ kmodules.xyz/custom-resources/apis/appcatalog
kmodules.xyz/custom-resources/client/informers/externalversions/appcatalog
kmodules.xyz/custom-resources/client/informers/externalversions/internalinterfaces
kmodules.xyz/custom-resources/client/informers/externalversions/appcatalog/v1alpha1
# kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3
# kmodules.xyz/objectstore-api v0.0.0-20191106100235-bea39a8e0874
kmodules.xyz/objectstore-api/api/v1
kmodules.xyz/objectstore-api/osm
# kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c
Expand Down

0 comments on commit decea34

Please sign in to comment.