controller-runtime
controller-runtime copied to clipboard
admission.Decoder.Decode is panicking after version bump
I updated controller-runtime
from v0.14.4
to v0.15.3
along with k8s.io/*
from v0.26.2
to v0.27.7
.
type PodMut struct {
decoder *admission.Decoder
...
}
func (pm *PodMut) Handle(ctx context.Context, req admission.Request) admission.Response {
pod := &corev1.Pod{}
err := pm.decoder.Decode(req, pod)
...
}
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:920 +0x270
sigs.k8s.io/controller-runtime/pkg/webhook/admission.(*Decoder).DecodeRaw(0x0, {{0xc000018b00, 0x2049, 0x2529}, {0x0, 0x0}}, {0x1a42b72, 0xc000229690})
I don't see any breaking changes for this in release log. I also inspected the dump using spew couldn't figure out why it's panicking.