Skip to content

Commit b83a028

Browse files
authored
Avoid changing kcp on bootstrap config changes (#1132)
Signed-off-by: Alexey Makhov <[email protected]> Signed-off-by: makhov <[email protected]>
1 parent 3598968 commit b83a028

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/controller/controlplane/k0s_controlplane_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ func (c *K0sController) deleteK0sNodeResources(ctx context.Context, cluster *clu
589589

590590
func (c *K0sController) createBootstrapConfig(ctx context.Context, name string, _ *clusterv1.Cluster, kcp *cpv1beta1.K0sControlPlane, machine *clusterv1.Machine, clusterName string) error {
591591

592-
kcp.Spec.K0sConfigSpec.Args = uniqueArgs(kcp.Spec.K0sConfigSpec.Args)
592+
k0sConfigSpec := kcp.Spec.K0sConfigSpec.DeepCopy()
593+
k0sConfigSpec.Args = uniqueArgs(k0sConfigSpec.Args)
593594

594595
controllerConfig := bootstrapv1.K0sControllerConfig{
595596
TypeMeta: metav1.TypeMeta{
@@ -612,7 +613,7 @@ func (c *K0sController) createBootstrapConfig(ctx context.Context, name string,
612613
},
613614
Spec: bootstrapv1.K0sControllerConfigSpec{
614615
Version: kcp.Spec.Version,
615-
K0sConfigSpec: &kcp.Spec.K0sConfigSpec,
616+
K0sConfigSpec: k0sConfigSpec,
616617
},
617618
}
618619

0 commit comments

Comments
 (0)