fix the cleanup logic so that it does not panic if namespace is nil #494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
prior to the change, I observed this error which is related to the nil ptr dereferencing.
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=0x28 pc=0x10b139b]
goroutine 104 [running]:
testing.tRunner.func1(0xc000365000)
/usr/local/go/src/testing/testing.go:830 +0x392
panic(0x11e8540, 0x2085870)
/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/grafeas/kritis/integration.deleteObject(0x1379ca7, 0x1e, 0xc00058e360, 0x1f, 0x0, 0xc00058e380, 0x20)
/go/src/github.com/grafeas/kritis/integration/cleanup.go:53 +0x27b
github.com/grafeas/kritis/integration.cleanupInstall(0xc00068a140, 0x13836c6, 0x26)
/go/src/github.com/grafeas/kritis/integration/cleanup.go:39 +0x314
github.com/grafeas/kritis/integration.installKritis.func1(0xc000365000)
/go/src/github.com/grafeas/kritis/integration/run_test.go:205 +0x4ed
github.com/grafeas/kritis/integration.setUpKritisInNS.func1(0xc000365000)
/go/src/github.com/grafeas/kritis/integration/run_test.go:282 +0x38
github.com/grafeas/kritis/integration.setUpISP.func1(0xc000365000)
/go/src/github.com/grafeas/kritis/integration/run_test.go:321 +0x73
github.com/grafeas/kritis/integration.TestKritisISPLogic(0xc000365000)
/go/src/github.com/grafeas/kritis/integration/run_test.go:567 +0x713
testing.tRunner(0xc000365000, 0x13eb560)
/usr/local/go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:916 +0x35a
FAIL github.com/grafeas/kritis/integration 968.278s
make: *** [integration-prod] Error 1
Makefile:136: recipe for target 'integration-prod' failed