• Matt Rasmus's avatar
    test(tiller): cover crash fixed by #4630 (#4853) · 0522b34e
    Matt Rasmus authored
    While investigating a tiller crash on v2.10.0 (see recent comments in #3125), I pulled down the code
    and wrote a test replicating the crash I was experiencing. I then
    realized that the crash had been fixed, and was able to locate the fix
    in #4630 after running a quck bisect.
    
    Since there don't appear to be any tests that cover this crash, and I
    had written one myself, I figured I might as well put up a PR for it.
    
    Here's what the test failure on v2.10.0 looks like:
    ```
    -- FAIL: TestUpdateReleasePendingInstall_Force (0.00s)
    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=0x50 pc=0x1d128d8]
    
    goroutine 235 [running]:
    testing.tRunner.func1(0xc420493c20)
            /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:742 +0x29d
    panic(0x1eb8d80, 0x2a12db0)
            /usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:505 +0x229
    k8s.io/helm/pkg/tiller.(*ReleaseServer).performUpdateForce(0xc4208210b0, 0xc4202c6dc0, 0x0, 0x0, 0x2174220)
            /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update.go:166 +0x188
    k8s.io/helm/pkg/tiller.(*ReleaseServer).UpdateRelease(0xc4208210b0, 0x2191780, 0xc420820f30, 0xc4202c6dc0, 0x29aeb90, 0x38, 0x2d2)
            /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update.go:43 +0x245
    k8s.io/helm/pkg/tiller.TestUpdateReleasePendingInstall_Force(0xc420493c20)
            /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update_test.go:549 +0x120
    testing.tRunner(0xc420493c20, 0x20e5c70)
            /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
    created by testing.(*T).Run
            /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
    FAIL    k8s.io/helm/pkg/tiller  0.118s
    ```
    Signed-off-by: 's avatarMatt Rasmus <mrasmus@betterworks.com>
    0522b34e
Name
Last commit
Last update
..
environment Loading commit data...
hook_sorter.go Loading commit data...
hook_sorter_test.go Loading commit data...
hooks.go Loading commit data...
hooks_test.go Loading commit data...
kind_sorter.go Loading commit data...
kind_sorter_test.go Loading commit data...
release_content.go Loading commit data...
release_content_test.go Loading commit data...
release_history.go Loading commit data...
release_history_test.go Loading commit data...
release_install.go Loading commit data...
release_install_test.go Loading commit data...
release_list.go Loading commit data...
release_list_test.go Loading commit data...
release_modules.go Loading commit data...
release_rollback.go Loading commit data...
release_rollback_test.go Loading commit data...
release_server.go Loading commit data...
release_server_test.go Loading commit data...
release_status.go Loading commit data...
release_status_test.go Loading commit data...
release_testing.go Loading commit data...
release_testing_test.go Loading commit data...
release_uninstall.go Loading commit data...
release_uninstall_test.go Loading commit data...
release_update.go Loading commit data...
release_update_test.go Loading commit data...
release_version.go Loading commit data...
resource_policy.go Loading commit data...
server.go Loading commit data...