controller-runtime
controller-runtime copied to clipboard
:bug: fix(controllerutil): avoid panic when the MutateFn is nil
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