controller-runtime icon indicating copy to clipboard operation
controller-runtime copied to clipboard

:bug: fix(controllerutil): avoid panic when the MutateFn is nil

Open 0xff-dev opened this issue 9 months ago • 7 comments

I checked the CreateOrPatch function and it checked if MutateFn is nil, but CreateOrUpdate did not check.

Or is it possible to modify the mutate function directly and execute MutateFn only when MutateFn is not nil? https://github.com/kubernetes-sigs/controller-runtime/blob/5dcea7e94b7158e410d22f4a1eed16780497fe66/pkg/controller/controllerutil/controllerutil.go#L425

0xff-dev avatar May 14 '24 10:05 0xff-dev