Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ func (oc *OpenstackClient) Update(ctx context.Context, machine *machinev1.Machin
}

func (oc *OpenstackClient) reconcile(ctx context.Context, machine *machinev1.Machine) error {
originalResourceVersion := machine.ResourceVersion

machineSpec, err := clients.MachineSpecFromProviderSpec(machine.Spec.ProviderSpec)
if err != nil {
return maoMachine.InvalidMachineConfiguration("Cannot unmarshal providerSpec for %s: %v", machine.Name, err)
Expand Down Expand Up @@ -233,7 +235,10 @@ func (oc *OpenstackClient) reconcile(ctx context.Context, machine *machinev1.Mac
return err
}

oc.eventRecorder.Eventf(machine, corev1.EventTypeNormal, "Reconciled", "Reconciled machine %v", machine.Name)
// Only record the Updated event if the machine was actually modified
if machine.ResourceVersion != originalResourceVersion {
oc.eventRecorder.Eventf(machine, corev1.EventTypeNormal, "Updated", "Updated machine %v", machine.Name)
}
return nil
}

Expand Down