@@ -622,7 +622,7 @@ func computeMachineDeployment(ctx context.Context, s *scope.Scope, machineDeploy
622
622
currentObjectRef : currentBootstrapTemplateRef ,
623
623
// Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
624
624
// in case of errors in between creating this template and creating/updating the MachineDeployment object
625
- // with the reference to the ControlPlane object using this template.
625
+ // with the reference to this template.
626
626
ownerRef : ownerReferenceTo (s .Current .Cluster ),
627
627
})
628
628
if err != nil {
@@ -650,7 +650,7 @@ func computeMachineDeployment(ctx context.Context, s *scope.Scope, machineDeploy
650
650
currentObjectRef : currentInfraMachineTemplateRef ,
651
651
// Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
652
652
// in case of errors in between creating this template and creating/updating the MachineDeployment object
653
- // with the reference to the ControlPlane object using this template.
653
+ // with the reference to this template.
654
654
ownerRef : ownerReferenceTo (s .Current .Cluster ),
655
655
})
656
656
if err != nil {
@@ -974,6 +974,10 @@ func computeMachinePool(_ context.Context, s *scope.Scope, machinePoolTopology c
974
974
cluster : s .Current .Cluster ,
975
975
nameGenerator : names .SimpleNameGenerator (bootstrapConfigNamePrefix (s .Current .Cluster .Name , machinePoolTopology .Name )),
976
976
currentObjectRef : currentBootstrapConfigRef ,
977
+ // Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
978
+ // in case of errors in between creating this template and creating/updating the MachinePool object
979
+ // with the reference to this template.
980
+ ownerRef : ownerReferenceTo (s .Current .Cluster ),
977
981
})
978
982
if err != nil {
979
983
return nil , errors .Wrapf (err , "failed to compute bootstrap object for topology %q" , machinePoolTopology .Name )
@@ -998,6 +1002,10 @@ func computeMachinePool(_ context.Context, s *scope.Scope, machinePoolTopology c
998
1002
cluster : s .Current .Cluster ,
999
1003
nameGenerator : names .SimpleNameGenerator (infrastructureMachinePoolNamePrefix (s .Current .Cluster .Name , machinePoolTopology .Name )),
1000
1004
currentObjectRef : currentInfraMachinePoolRef ,
1005
+ // Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
1006
+ // in case of errors in between creating this template and creating/updating the MachinePool object
1007
+ // with the reference to this template.
1008
+ ownerRef : ownerReferenceTo (s .Current .Cluster ),
1001
1009
})
1002
1010
if err != nil {
1003
1011
return nil , errors .Wrapf (err , "failed to compute infrastructure object for topology %q" , machinePoolTopology .Name )
0 commit comments