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

The custom mutation handler failed to process the deletion request of CR #2048

Closed
iiiceoo opened this issue Nov 18, 2022 · 1 comment · Fixed by #2049
Closed

The custom mutation handler failed to process the deletion request of CR #2048

iiiceoo opened this issue Nov 18, 2022 · 1 comment · Fixed by #2049

Comments

@iiiceoo
Copy link
Contributor

iiiceoo commented Nov 18, 2022

Version

  • controller-runtime: v0.13.0
  • Kubernetes: 1.23.4

Reproduce

  1. Enable CRD deletion mutation in MutatingWebhookConfiguration.
  2. Execute kubectl delete <CRD> <CR>, and get error message "there is no content to decode".

Reference

#1762
#1765

@iiiceoo
Copy link
Contributor Author

iiiceoo commented Nov 18, 2022

I encountered the same problem as in #1762. When I delete the CR, the error "there is no content to decode" is returned from the mutating webhook.

The only difference is that I registered webhook for CR in the following way:

return ctrl.NewWebhookManagedBy(sm.runtimeMgr).
	For(&xxx.CR{}).
	WithDefaulter(sm).
	WithValidator(sm).
	Complete()

Then I found that the bug was only solved in the handler of interface Defaulter, but not in interface CustomDefaulter.

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