-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Unless I'm very confused right now, this code in defaultAndValidateMachineSpec() (part the of the mutating webhooks)
machine-controller/pkg/admission/machines.go
Line 185 in 94e2005
spec = &defaultedSpec |
...only updates the passed-in pointer to the to-be-defaulted MachineSpec, but doesn't update the MachineSpec it points to. So the updated object will be garbage collected and the caller's MachineSpec will not be updated (i.e. defaulted).
Changing the line to something like *spec = defaultedSpec
should fix it (or changing some function signatures so we pass pointers rather than values). I'm not sure about the implications because it seems like this bug has been in there since 2018. So maybe nobody really needed the provider-specific defaulting functionality?