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

fix the cleanup logic so that it does not panic if namespace is nil #494

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

liuplgtm
Copy link

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

@liuplgtm liuplgtm requested review from aysylu and ooq April 22, 2020 17:57
@liuplgtm liuplgtm requested a review from wkozlik April 22, 2020 18:00
Copy link
Contributor

@ooq ooq left a comment

Choose a reason for hiding this comment

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

Nice catch! LGTM

Copy link
Contributor

@wkozlik wkozlik left a comment

Choose a reason for hiding this comment

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

LGTM

@ooq
Copy link
Contributor

ooq commented Jun 25, 2020

@liuplgtm , IIRC, we found that: this fix makes sense, but it didn't fix the kokoro test back then.
Should we merge this anyway?

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