Skip to content
Merged
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
11 changes: 6 additions & 5 deletions pkg/cloud/openstack/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,11 @@ func (oc *OpenstackClient) Update(ctx context.Context, cluster *clusterv1.Cluste
return nil
}

// FIXME(mandre) Find the right way to check if machine is part of the control plane
if currentMachine.ObjectMeta.Name != "" {
if _, ok := currentMachine.Labels["node-role.kubernetes.io/master"]; ok {
// TODO: add master inplace
klog.Errorf("master inplace update failed: not support master in place update now")
klog.Errorf("master inplace update failed: not supported")
return oc.handleMachineError(machine, apierrors.UpdateMachine(
"master inplace update failed: not supported"), updateEventAction)
} else {
klog.Infof("re-creating machine %s for update.", currentMachine.ObjectMeta.Name)
err = oc.Delete(ctx, cluster, currentMachine)
Expand All @@ -384,7 +385,7 @@ func (oc *OpenstackClient) Update(ctx context.Context, cluster *clusterv1.Cluste
})
if err != nil {
return oc.handleMachineError(machine, apierrors.DeleteMachine(
"error deleting Openstack instance: %v", err), deleteEventAction)
"error deleting Openstack instance: %v", err), updateEventAction)
}
err = oc.Create(ctx, cluster, machine)
if err != nil {
Expand All @@ -394,7 +395,7 @@ func (oc *OpenstackClient) Update(ctx context.Context, cluster *clusterv1.Cluste
klog.Infof("Successfully updated machine %s", currentMachine.ObjectMeta.Name)
}

oc.eventRecorder.Eventf(currentMachine, corev1.EventTypeNormal, "Updated", "Updated machine %v", currentMachine.ObjectMeta.Name, updateEventAction)
oc.eventRecorder.Eventf(currentMachine, corev1.EventTypeNormal, "Updated", "Updated machine %v", currentMachine.ObjectMeta.Name)
return nil
}

Expand Down