@@ -175,14 +175,12 @@ func (r *Reconciler) createMachineSetAndWait(ctx context.Context, deployment *cl
175175 log = log .WithValues ("MachineSet" , klog .KObj (newMS ))
176176 ctx = ctrl .LoggerInto (ctx , log )
177177
178- log .Info (fmt .Sprintf ("Creating new MachineSet, %s" , createReason ))
179-
180178 // Create the MachineSet.
181179 if err := ssa .Patch (ctx , r .Client , machineDeploymentManagerName , newMS ); err != nil {
182180 r .recorder .Eventf (deployment , corev1 .EventTypeWarning , "FailedCreate" , "Failed to create MachineSet %s: %v" , klog .KObj (newMS ), err )
183181 return nil , errors .Wrapf (err , "failed to create new MachineSet %s" , klog .KObj (newMS ))
184182 }
185- log .V ( 4 ). Info ( "Created new MachineSet" )
183+ log .Info ( fmt . Sprintf ( "MachineSet created (%s)" , createReason ) )
186184 r .recorder .Eventf (deployment , corev1 .EventTypeNormal , "SuccessfulCreate" , "Created MachineSet %s" , klog .KObj (newMS ))
187185
188186 // Keep trying to get the MachineSet. This will force the cache to update and prevent any future reconciliation of
@@ -647,6 +645,8 @@ func (r *Reconciler) cleanupDeployment(ctx context.Context, oldMSs []*clusterv1.
647645 r .recorder .Eventf (deployment , corev1 .EventTypeWarning , "FailedDelete" , "Failed to delete MachineSet %q: %v" , ms .Name , err )
648646 return err
649647 }
648+ // Note: We intentionally log after Delete because we want this log line to show up only after DeletionTimestamp has been set.
649+ log .Info ("Deleting MachineSet (cleanup of old MachineSet)" , "MachineSet" , klog .KObj (ms ))
650650 r .recorder .Eventf (deployment , corev1 .EventTypeNormal , "SuccessfulDelete" , "Deleted MachineSet %q" , ms .Name )
651651 }
652652
0 commit comments