@@ -617,7 +617,7 @@ func computeMachineDeployment(ctx context.Context, s *scope.Scope, machineDeploy
617
617
currentObjectRef : currentBootstrapTemplateRef ,
618
618
// Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
619
619
// in case of errors in between creating this template and creating/updating the MachineDeployment object
620
- // with the reference to the ControlPlane object using this template.
620
+ // with the reference to this template.
621
621
ownerRef : ownerReferenceTo (s .Current .Cluster ),
622
622
})
623
623
@@ -642,7 +642,7 @@ func computeMachineDeployment(ctx context.Context, s *scope.Scope, machineDeploy
642
642
currentObjectRef : currentInfraMachineTemplateRef ,
643
643
// Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
644
644
// in case of errors in between creating this template and creating/updating the MachineDeployment object
645
- // with the reference to the ControlPlane object using this template.
645
+ // with the reference to this template.
646
646
ownerRef : ownerReferenceTo (s .Current .Cluster ),
647
647
})
648
648
@@ -953,6 +953,10 @@ func computeMachinePool(_ context.Context, s *scope.Scope, machinePoolTopology c
953
953
cluster : s .Current .Cluster ,
954
954
namePrefix : bootstrapConfigNamePrefix (s .Current .Cluster .Name , machinePoolTopology .Name ),
955
955
currentObjectRef : currentBootstrapConfigRef ,
956
+ // Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
957
+ // in case of errors in between creating this template and creating/updating the MachinePool object
958
+ // with the reference to this template.
959
+ ownerRef : ownerReferenceTo (s .Current .Cluster ),
956
960
})
957
961
if err != nil {
958
962
return nil , errors .Wrapf (err , "failed to compute bootstrap object for topology %q" , machinePoolTopology .Name )
@@ -977,6 +981,10 @@ func computeMachinePool(_ context.Context, s *scope.Scope, machinePoolTopology c
977
981
cluster : s .Current .Cluster ,
978
982
namePrefix : infrastructureMachinePoolNamePrefix (s .Current .Cluster .Name , machinePoolTopology .Name ),
979
983
currentObjectRef : currentInfraMachinePoolRef ,
984
+ // Note: we are adding an ownerRef to Cluster so the template will be automatically garbage collected
985
+ // in case of errors in between creating this template and creating/updating the MachinePool object
986
+ // with the reference to this template.
987
+ ownerRef : ownerReferenceTo (s .Current .Cluster ),
980
988
})
981
989
if err != nil {
982
990
return nil , errors .Wrapf (err , "failed to compute infrastructure object for topology %q" , machinePoolTopology .Name )
0 commit comments