diff --git a/pkg/controller/machineset/controller.go b/pkg/controller/machineset/controller.go index 03910d5c907e..b61c13527f20 100644 --- a/pkg/controller/machineset/controller.go +++ b/pkg/controller/machineset/controller.go @@ -257,11 +257,6 @@ func (c *MachineSetControllerImpl) createMachine(machineSet *v1alpha1.MachineSet // shoudExcludeMachine returns true if the machine should be filtered out, false otherwise. func shouldExcludeMachine(machineSet *v1alpha1.MachineSet, machine *v1alpha1.Machine) bool { // Ignore inactive machines. - if machine.DeletionTimestamp != nil || !machine.DeletionTimestamp.IsZero() { - glog.V(4).Infof("Skipping machine (%v), as it is being deleted.", machine.Name) - return true - } - if metav1.GetControllerOf(machine) != nil && !metav1.IsControlledBy(machine, machineSet) { glog.V(4).Infof("%s not controlled by %v", machine.Name, machineSet.Name) return true diff --git a/pkg/controller/machineset/reconcile_test.go b/pkg/controller/machineset/reconcile_test.go index fb5e46fbf5bb..dadfebd1d538 100644 --- a/pkg/controller/machineset/reconcile_test.go +++ b/pkg/controller/machineset/reconcile_test.go @@ -165,13 +165,12 @@ func TestMachineSetControllerReconcileHandler(t *testing.T) { expectedMachine: machineFromMachineSet(createMachineSet(1, "foo", "bar2", "acme"), "bar2"), }, { - name: "scenario 9: the current machine is being deleted, thus a machine is created.", + name: "scenario 9: the current machine is being deleted, is still counted towards the machine set, no machine resource is created.", startingMachineSets: []*v1alpha1.MachineSet{createMachineSet(1, "foo", "bar2", "acme")}, startingMachines: []*v1alpha1.Machine{setMachineDeleting(machineFromMachineSet(createMachineSet(1, "foo", "bar1", "acme"), "bar1"))}, machineSetToSync: "foo", namespaceToSync: "acme", - expectedActions: []string{"create"}, - expectedMachine: machineFromMachineSet(createMachineSet(1, "foo", "bar2", "acme"), "bar2"), + expectedActions: []string{}, }, { name: "scenario 10: the current machine has no controller refs, owner refs preserved, machine should be adopted.",