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
v0.8.3: admission.Handler is being injected with a nil admission.Decoder #1487
Comments
I'm officially stuck on where this issue could be happening. With regards to the
So, all of the resource we want to handle in our handlers (both validating and mutating) are being added to the manager's scheme, yet the handlers are consistently getting nil decoders injected. I have looked through the controller-runtime packages, and seen how the |
Can you please post a stack trace where you see this Maybe in your case it simply is not passed at all, and you're observing the |
Hi @porridge! @d-honeybadger and I were working on this, and she may have found the culprit. I say "may" because although this fix works, it could indicate the code we are working with is doing something incorrectly. In https://github.com/kubernetes-sigs/controller-runtime/pull/1307/files#diff-517abdd2f47b744e11990598de732426f33aba68600eaa9600d2ee20bc0b25dcL227-L256, the order of injection functions changes slightly, resulting in The "fix" in this case, is to move the call to EDIT: I had previously missed (or dismissed) this error when I initially encountered it:
This error message shows up in the logs after the |
@porridge Looking more closely, the "just-in-case" decoder injection that you pointed out indeed works for most webhooks. The one case where it doesn't work is a webhook with a Since |
FIxed in #1502 |
Hi there!
Recently, I have been upgrading a code base from
sigs.k8s.io/controller-runtime
from v0.6.0 → v0.8.3. In v0.6.0, everything was working fine, but after updating to v0.8.3, ouradmission.Handler
s are being injected with nil*admission.Decoder
s.Nothing has changed with how we are registering any CRDs.
I am still doing some digging through the changesets between 0.6.0 and 0.8.3 to see if anything changed with regards to decoder injection, but I wanted to file this issue just to get the ball rolling. I will post a comment for anything I find along the way.
Dependencies
As a side note about dependencies, any dependencies in the
k8s.io/
tree had already been updated to a v.20.x tag. Thek8s.io/
packages are updated separately, and when updating to controller-runtime v0.8.3, nok8s.io/
packages were updated as a side-effect, since thek8s.io/
packages were already at compatible version.I felt it necessary to mention this aspect, to preempt any discussion about
k8s.io/
package versions, since the only change in dependencies that occurred before this issue started, was bumpingsigs.k8s.io/controller-runtime
from 0.6.0 → 0.8.3.The text was updated successfully, but these errors were encountered: