File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
controlplane/kubeadm/internal Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -213,13 +213,15 @@ func cleanupConfigFields(kcpConfig *bootstrapv1.KubeadmConfigSpec, machineConfig
213
213
214
214
// If KCP JoinConfiguration.ControlPlane is not present, set machine join configuration to nil (nothing can trigger rollout here).
215
215
// NOTE: this is required because CABPK applies an empty joinConfiguration.ControlPlane in case no one is provided.
216
- if kcpConfig .JoinConfiguration != nil && kcpConfig .JoinConfiguration .ControlPlane == nil {
216
+ if kcpConfig .JoinConfiguration != nil && kcpConfig .JoinConfiguration .ControlPlane == nil &&
217
+ machineConfig .Spec .JoinConfiguration != nil {
217
218
machineConfig .Spec .JoinConfiguration .ControlPlane = nil
218
219
}
219
220
220
221
// If KCP's join NodeRegistration is empty, set machine's node registration to empty as no changes should trigger rollout.
221
222
emptyNodeRegistration := bootstrapv1.NodeRegistrationOptions {}
222
- if kcpConfig .JoinConfiguration != nil && reflect .DeepEqual (kcpConfig .JoinConfiguration .NodeRegistration , emptyNodeRegistration ) {
223
+ if kcpConfig .JoinConfiguration != nil && reflect .DeepEqual (kcpConfig .JoinConfiguration .NodeRegistration , emptyNodeRegistration ) &&
224
+ machineConfig .Spec .JoinConfiguration != nil {
223
225
machineConfig .Spec .JoinConfiguration .NodeRegistration = emptyNodeRegistration
224
226
}
225
227
You can’t perform that action at this time.
0 commit comments