fix crash when run sonobuoy in serverless kubernetes cluster #1108
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.
We found a crash when ran sonobuoy in serverless kubernetes cluster, see below error log.
In serverless kubernetes cluster, pod may need 10s to start after creation, before container start, pod.Status.StartTime is nil.
kubectl -n sonobuoy get pod
NAME READY STATUS RESTARTS AGE
sonobuoy 0/1 Error 0 4h57m
sonobuoy-e2e-job-61031ae7baac48e1 2/2 Running 0 4h57m
kubectl -n sonobuoy logs sonobuoy
time="2020-04-20T02:49:23Z" level=info msg="Starting aggregation server" address=0.0.0.0 port=8080
time="2020-04-20T02:49:23Z" level=info msg="Starting annotation update routine"
time="2020-04-20T02:49:23Z" level=info msg="Running plugin" plugin=e2e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1010651]
goroutine 121 [running]:
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils.IsPodFailing(0xc0004e8a80, 0x16a5e60, 0xc000514500, 0xc0004e8a80)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils/utils.go:71 +0x3b1
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).monitorOnce(0xc0000fa000, 0x16a5e60, 0xc000514500, 0x0, 0x0, 0x0, 0xc0003e8600, 0x0)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:219 +0x8d
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).Monitor(0xc0000fa000, 0x16744e0, 0xc000129ec0, 0x16a5e60, 0xc000514500, 0xc000284840, 0x1, 0x1, 0xc000129e00)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:195 +0x190
created by github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation.(*Aggregator).RunAndMonitorPlugin
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation/run.go:233 +0x227
What this PR does / why we need it:
Which issue(s) this PR fixes
Special notes for your reviewer:
Release note: