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

Error in WebHook - expected webhook response of admission.k8s.io/v1, Kind=AdmissionReview, got /, Kind= #47

Open
dev-chirag opened this issue Apr 28, 2023 · 2 comments

Comments

@dev-chirag
Copy link

Hi,

I know there isnt a lot of activity in this project. Still trying my luck.

For any pod that I am trying to create (with or without the annotation), I am getting this exception:

Warning  FailedCreate  49s (x17 over 6m16s)  replicaset-controller  Error creating: Internal error occurred: failed calling webhook "sidecarinjector.sfdc.internal": received invalid webhook response: expected webhook response of admission.k8s.io/v1, Kind=AdmissionReview, got /, Kind=

Anything I am missing in the configuration?

@jasondiazg
Copy link

I am not pretty sure about it, but I think it is for the Kubernetes version, the code should be modified to us an upgraded version.

@jasondiazg
Copy link

jasondiazg commented Nov 21, 2023

I checked the code and it seems like it was upgraded some time ago, however, I built the docker image by my own and it is generating this issue and I don't know what is wrong:

http: panic serving 10.244.23.26:38206: runtime error: invalid memory address or nil pointer dereference
goroutine 38 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1868 +0xb9
panic({0xc965e0?, 0x148bd50?})
	/usr/local/go/src/runtime/panic.go:920 +0x270
github.com/salesforce/generic-sidecar-injector/pkg/injectionwebhook.(*WebhookServer).mutate(0xc0001e25c0, 0xc0004bce70)
	/sidecarinjector/pkg/injectionwebhook/webhook.go:144 +0x471
github.com/salesforce/generic-sidecar-injector/pkg/injectionwebhook.(*WebhookServer).serve(0x40dd05?, {0x7f3f6308b140, 0xc00038e2d0}, 0xc00022a000)
	/sidecarinjector/pkg/injectionwebhook/webhook.go:215 +0x32e
net/http.HandlerFunc.ServeHTTP(0xecfb00?, {0x7f3f6308b140?, 0xc00038e2d0?}, 0xc0004bce10?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
github.com/salesforce/generic-sidecar-injector/pkg/metrics.GetHTTPMetricHandler.(*PromHTTPHandler).withInFlight.InstrumentHandlerInFlight.func1({0x7f3f6308b140, 0xc00038e2d0}, 0x7f3f6308b100?)
	/sidecarinjector/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:60 +0xcb
net/http.HandlerFunc.ServeHTTP(0x7f3f6308b140?, {0x7f3f6308b140?, 0xc00038e2d0?}, 0xc000080400?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1({0x7f3f6308b140?, 0xc00038e280?}, 0xc00022a000)
	/sidecarinjector/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:147 +0xb6
net/http.HandlerFunc.ServeHTTP(0x7f3f6308b140?, {0x7f3f6308b140?, 0xc00038e280?}, 0xd41360?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func1({0x7f3f6308b140, 0xc00038e230}, 0xc00022a000)
	/sidecarinjector/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:97 +0xf9
net/http.HandlerFunc.ServeHTTP(0xed6988?, {0x7f3f6308b140?, 0xc00038e230?}, 0x7?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerResponseSize.func1({0xed6988?, 0xc00021a000?}, 0xc00022a000)
	/sidecarinjector/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:296 +0xca
net/http.HandlerFunc.ServeHTTP(0xc0004d4050?, {0xed6988?, 0xc00021a000?}, 0x7da0e5?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
net/http.HandlerFunc.ServeHTTP(0x10?, {0xed6988?, 0xc00021a000?}, 0xc0003b612c?)
	/usr/local/go/src/net/http/server.go:2136 +0x29
net/http.(*ServeMux).ServeHTTP(0x4105a5?, {0xed6988, 0xc00021a000}, 0xc00022a000)
	/usr/local/go/src/net/http/server.go:2514 +0x142
net/http.serverHandler.ServeHTTP({0xed20c8?}, {0xed6988?, 0xc00021a000?}, 0x6?)
	/usr/local/go/src/net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc0004b8000, {0xed8948, 0xc00023e600})
	/usr/local/go/src/net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 49
	/usr/local/go/src/net/http/server.go:3086 +0x5cb

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

No branches or pull requests

2 participants