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

admission webhook controller throwing exception in 0.1.0 release #167

Closed
diranged opened this issue Aug 16, 2023 · 1 comment · Fixed by #168
Closed

admission webhook controller throwing exception in 0.1.0 release #167

diranged opened this issue Aug 16, 2023 · 1 comment · Fixed by #168

Comments

@diranged
Copy link
Owner

2023-08-16T12:31:38Z	INFO	admission	Handling CONNECT Operation on pods/diranged-nxwf5-dd2747d0 by [email protected]	{"object": {"name":"diranged-nxwf5-dd2747d0","namespace":"xxx"}, "namespace": "xxx", "name": "diranged-nxwf5-dd2747d0", "resource": {"group":"","version":"v1","resource":"pods"}, "user": "[email protected]", "requestID": "0619762f-8a30-4586-b07b-cbcd8a1c0a7a", "request": "{\"uid\":\"0619762f-8a30-4586-b07b-cbcd8a1c0a7a\",\"kind\":{\"group\":\"\",\"version\":\"v1\",\"kind\":\"PodExecOptions\"},\"resource\":{\"group\":\"\",\"version\":\"v1\",\"resource\":\"pods\"},\"subResource\":\"exec\",\"requestKind\":{\"group\":\"\",\"version\":\"v1\",\"kind\":\"PodExecOptions\"},\"requestResource\":{\"group\":\"\",\"version\":\"v1\",\"resource\":\"pods\"},\"requestSubResource\":\"exec\",\"name\":\"diranged-nxwf5-dd2747d0\",\"namespace\":\"xxx\",\"operation\":\"CONNECT\",\"userInfo\":{\"username\":\"[email protected]\",\"groups\":[...]},\"object\":{\"kind\":\"PodExecOptions\",\"apiVersion\":\"v1\",\"stdin\":true,\"stdout\":true,\"tty\":true,\"container\":\"zzz\",\"command\":[\"/entrypoint.sh\"]},\"oldObject\":null,\"dryRun\":false,\"options\":null}"}
2023/08/16 12:31:38 http: panic serving 100.64.125.225:35478: runtime error: invalid memory address or nil pointer dereference
goroutine 2105 [running]:
net/http.(*conn).serve.func1()
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:1850 +0xb8
panic({0x11322c0, 0x2112370})
	/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/panic.go:890 +0x260
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Decoder).DecodeRaw(0x0, {{0x4004fc8280, 0x9a, 0xa0}, {0x0, 0x0}}, {0x15826a8, 0x4004f93590})
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/decode.go:76 +0xec
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Decoder).Decode(_, {{{0x4003b82450, 0x24}, {{0x0, 0x0}, {0x4003efed48, 0x2}, {0x4003efed70, 0xe}}, {{0x0, ...}, ...}, ...}}, ...)
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/decode.go:49 +0x74
github.com/diranged/oz/internal/controllers/podwatcher.(*PodWatcher).HandleExec(_, {_, _}, {{{0x4003b82450, 0x24}, {{0x0, 0x0}, {0x4003efed48, 0x2}, {0x4003efed70, ...}}, ...}})
	/home/runner/work/oz/oz/internal/controllers/podwatcher/handle_exec.go:20 +0xb4
github.com/diranged/oz/internal/controllers/podwatcher.(*PodWatcher).Handle(_, {_, _}, {{{0x4003b82450, 0x24}, {{0x0, 0x0}, {0x4003efed48, 0x2}, {0x4003efed70, ...}}, ...}})
	/home/runner/work/oz/oz/internal/controllers/podwatcher/handle.go:46 +0x364
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).Handle(_, {_, _}, {{{0x4003b82450, 0x24}, {{0x0, 0x0}, {0x4003efed48, 0x2}, {0x4003efed70, ...}}, ...}})
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/webhook.go:169 +0x188
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Webhook).ServeHTTP(0x400059eaf0, {0xffff6ce27660?, 0x4004f934a0}, 0x40021dec00)
	/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/webhook/admission/http.go:98 +0x960
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1({0xffff6ce27660, 0x4004f934a0}, 0x4004254f00?)
	/home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:60 +0xb0
net/http.HandlerFunc.ServeHTTP(0x1591e60?, {0xffff6ce27660?, 0x4004f934a0?}, 0x3616e8?)
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2109 +0x38
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x1591e60?, 0x4000e821c0?}, 0x40021dec00)
	/home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:147 +0xa0
net/http.HandlerFunc.ServeHTTP(0x4003883a58?, {0x1591e60?, 0x4000e821c0?}, 0x400385c840?)
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2109 +0x38
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func2({0x1591e60, 0x4000e821c0}, 0x40021dec00)
	/home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/promhttp/instrument_server.go:109 +0x94
net/http.HandlerFunc.ServeHTTP(0x4000e821c0?, {0x1591e60?, 0x4000e821c0?}, 0x131bf21?)
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2109 +0x38
net/http.(*ServeMux).ServeHTTP(0x4003b82403?, {0x1591e60, 0x4000e821c0}, 0x40021dec00)
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2487 +0x140
net/http.serverHandler.ServeHTTP({0x1584868?}, {0x1591e60, 0x4000e821c0}, 0x40021dec00)
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2947 +0x2cc
net/http.(*conn).serve(0x4004f67860, {0x1592d58, 0x4000407020})
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:1991 +0x544
created by net/http.(*Server).Serve
	/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:3102 +0x43c
@diranged
Copy link
Owner Author

Went back and tested different builds, the failure is in 0049093.

diranged added a commit that referenced this issue Aug 16, 2023
diranged added a commit that referenced this issue Aug 16, 2023
diranged added a commit that referenced this issue Aug 16, 2023
diranged added a commit that referenced this issue Aug 16, 2023
Closes #167.

In #151 we updated some libraries and
we missed the fact that
kubernetes-sigs/controller-runtime#2134 removed
the `InjectDecoder` call entirely. This PR implements a live test of the
`CONNECT` functionality, as well as fixes for the decoder.
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 a pull request may close this issue.

1 participant