Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit when failing to update a backup's phase #500

Merged
merged 1 commit into from
May 17, 2018
Merged

Conversation

nrb
Copy link
Contributor

@nrb nrb commented May 17, 2018

Fixes #497

Signed-off-by: Nolan Brubaker nolan@heptio.com

@nrb nrb requested a review from ncdc May 17, 2018 15:38
@nrb
Copy link
Contributor Author

nrb commented May 17, 2018

Tests are currently failing; I'm trying to identify why my added test's reaction function isn't being called

Copy link
Contributor

@skriss skriss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 minor comment, otherwise LGTM.

@@ -263,6 +263,22 @@ func TestBackupDeletionControllerProcessRequest(t *testing.T) {
assert.EqualError(t, err, "error patching DeleteBackupRequest: bad")
})

t.Run("patching to Deleting fails", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"patching backup to Deleting fails"

Signed-off-by: Nolan Brubaker <nolan@heptio.com>
@skriss
Copy link
Contributor

skriss commented May 17, 2018

LGTM.

@ncdc
Copy link
Contributor

ncdc commented May 17, 2018

@nrb does the new unit test fail without the fix?

@nrb
Copy link
Contributor Author

nrb commented May 17, 2018

It doesn't fail gracefully at the moment, though it fails at the same spot as the bug report.

x1c in /home/nrb/go/src/github.com/heptio/ark (git) fix-497 U
% git --no-pager df
diff --git i/pkg/controller/backup_deletion_controller.go w/pkg/controller/backup_deletion_controller.go
index 0ef449c..06ba01b 100644
--- i/pkg/controller/backup_deletion_controller.go
+++ w/pkg/controller/backup_deletion_controller.go
@@ -211,7 +211,6 @@ func (c *backupDeletionController) processRequest(req *v1.DeleteBackupRequest) e
        })
        if err != nil {
                log.WithError(errors.WithStack(err)).Error("Error setting backup phase to deleting")
-               return err
        }

        var errs []string
x1c in /home/nrb/go/src/github.com/heptio/ark (git) fix-497 U
% make test
make[1]: Entering directory '/home/nrb/go/src/github.com/heptio/ark'
cd hack/build-image && docker build -t ark-builder .
Sending build context to Docker daemon   2.56kB
Step 1/2 : FROM golang:1.10-alpine3.7
 ---> 05fe62871090
Step 2/2 : RUN apk add --update --no-cache git bash &&     mkdir -p /go/src/k8s.io &&     cd /go/src/k8s.io &&     git clone -b kubernetes-1.10.0 https://github.com/kubernetes/code-generator &&     git clone -b kubernetes-1.10.0 https://github.com/kubernetes/apimachinery &&     echo chmod -R a+w /go
 ---> Using cache
 ---> d77a745ba043
Successfully built d77a745ba043
Successfully tagged ark-builder:latest
Running tests:
?       github.com/heptio/ark/cmd/ark   [no test files]
?       github.com/heptio/ark/pkg/apis/ark/v1   [no test files]
ok      github.com/heptio/ark/pkg/backup        (cached)
ok      github.com/heptio/ark/pkg/buildinfo     (cached)
ok      github.com/heptio/ark/pkg/client        (cached)
ok      github.com/heptio/ark/pkg/cloudprovider (cached)
ok      github.com/heptio/ark/pkg/cloudprovider/aws     (cached)
ok      github.com/heptio/ark/pkg/cloudprovider/azure   (cached)
ok      github.com/heptio/ark/pkg/cloudprovider/gcp     (cached)
?       github.com/heptio/ark/pkg/cmd   [no test files]
?       github.com/heptio/ark/pkg/cmd/ark       [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/backup        [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/client        [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/client/config [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/completion    [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/create        [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/delete        [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/describe      [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/get   [no test files]
ok      github.com/heptio/ark/pkg/cmd/cli/plugin        (cached)
?       github.com/heptio/ark/pkg/cmd/cli/restore       [no test files]
?       github.com/heptio/ark/pkg/cmd/cli/schedule      [no test files]
ok      github.com/heptio/ark/pkg/cmd/server    (cached)
?       github.com/heptio/ark/pkg/cmd/server/plugin     [no test files]
ok      github.com/heptio/ark/pkg/cmd/util/downloadrequest      (cached)
?       github.com/heptio/ark/pkg/cmd/util/flag [no test files]
ok      github.com/heptio/ark/pkg/cmd/util/output       (cached)
?       github.com/heptio/ark/pkg/cmd/version   [no test files]
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1d0 pc=0xf654e1]

goroutine 118 [running]:
testing.tRunner.func1(0xc4200d0870)
        /usr/local/go/src/testing/testing.go:742 +0x29d
panic(0x10b7c40, 0x1a18310)
        /usr/local/go/src/runtime/panic.go:502 +0x229
github.com/heptio/ark/pkg/controller.(*backupDeletionController).processRequest(0xc4200a2f20, 0xc4203f5040, 0x2, 0x2)
        /go/src/github.com/heptio/ark/pkg/controller/backup_deletion_controller.go:220 +0x511
github.com/heptio/ark/pkg/controller.TestBackupDeletionControllerProcessRequest.func4(0xc4200d0870)
        /go/src/github.com/heptio/ark/pkg/controller/backup_deletion_controller_test.go:278 +0x569
testing.tRunner(0xc4200d0870, 0x12a0288)
        /usr/local/go/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
        /usr/local/go/src/testing/testing.go:824 +0x2e0
FAIL    github.com/heptio/ark/pkg/controller    0.124s
ok      github.com/heptio/ark/pkg/discovery     (cached)
?       github.com/heptio/ark/pkg/generated/clientset/versioned [no test files]
?       github.com/heptio/ark/pkg/generated/clientset/versioned/fake    [no test files]
?       github.com/heptio/ark/pkg/generated/clientset/versioned/scheme  [no test files]
?       github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1    [no test files]
?       github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1/fake       [no test files]
?       github.com/heptio/ark/pkg/generated/informers/externalversions  [no test files]
?       github.com/heptio/ark/pkg/generated/informers/externalversions/ark      [no test files]
?       github.com/heptio/ark/pkg/generated/informers/externalversions/ark/v1   [no test files]
?       github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces       [no test files]
?       github.com/heptio/ark/pkg/generated/listers/ark/v1      [no test files]
?       github.com/heptio/ark/pkg/kuberesource  [no test files]
ok      github.com/heptio/ark/pkg/plugin        (cached)
?       github.com/heptio/ark/pkg/plugin/generated      [no test files]
ok      github.com/heptio/ark/pkg/restore       (cached)
?       github.com/heptio/ark/pkg/util/boolptr  [no test files]
ok      github.com/heptio/ark/pkg/util/collections      (cached)
?       github.com/heptio/ark/pkg/util/encode   [no test files]
ok      github.com/heptio/ark/pkg/util/kube     (cached)
ok      github.com/heptio/ark/pkg/util/logging  (cached)
ok      github.com/heptio/ark/pkg/util/stringslice      (cached)
?       github.com/heptio/ark/pkg/util/test     [no test files]
make[1]: *** [Makefile:97: shell] Error 1
make[1]: Leaving directory '/home/nrb/go/src/github.com/heptio/ark'
make: *** [Makefile:138: test] Error 2

@ncdc
Copy link
Contributor

ncdc commented May 17, 2018

This is what I would expect to see - thanks!

@ncdc ncdc added this to the v0.9.0 milestone May 17, 2018
@ncdc ncdc merged commit 2fde1f5 into vmware-tanzu:master May 17, 2018
danfengliu added a commit to danfengliu/velero that referenced this pull request Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants