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

Fixing panic during remove route of last route in webservice #275

Merged
merged 1 commit into from
Apr 11, 2016

Conversation

uruddarraju
Copy link

Solves the issue during a call to remove the last route of the webservice

E0410 07:26:58.832374       1 runtime.go:58] Recovered from panic: "index out of range" (runtime error: index out of range)
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/util/runtime/runtime.go:52
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/util/runtime/runtime.go:40
/usr/local/go/src/runtime/asm_amd64.s:472
/usr/local/go/src/runtime/panic.go:426
/usr/local/go/src/runtime/panic.go:15
/go/src/k8s.io/kubernetes/Godeps/_workspace/src/github.com/emicklei/go-restful/web_service.go:16

This solves the issue of IndexOutOfBounds from https://github.com/emicklei/go-restful/blob/master/web_service.go#L164

@emicklei
Copy link
Owner

Thank you for finding and solving this bug. Would be even better if we add a test for it.

@uruddarraju
Copy link
Author

Added a test to test deletion of a route for a webservice having multiple routes. The test results are as follows:

go test -run RemoveLastRoute
PASS
ok      github.com/emicklei/go-restful  0.008s

@emicklei
Copy link
Owner

Thank you @uruddarraju for this contribution

@uruddarraju
Copy link
Author

Thanks @emicklei for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants