From 11826fc0fe8ad8267e5d8c98b7b88cce13bdeb7c Mon Sep 17 00:00:00 2001 From: Mike Fedosin Date: Tue, 27 Aug 2019 16:18:50 +0200 Subject: [PATCH] Bug 1745939: Return error if image creation fails Now if CAPO cannot create an image it ignores the error and continue operating as the creation was successful. This patch returns the error if something wrong happens. --- pkg/cloud/openstack/machine/actuator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cloud/openstack/machine/actuator.go b/pkg/cloud/openstack/machine/actuator.go index 1a33a086de..419f69a19c 100644 --- a/pkg/cloud/openstack/machine/actuator.go +++ b/pkg/cloud/openstack/machine/actuator.go @@ -344,6 +344,7 @@ func (oc *OpenstackClient) Update(ctx context.Context, cluster *clusterv1.Cluste err = oc.Create(ctx, cluster, machine) if err != nil { klog.Errorf("create machine %s for update failed: %v", machine.ObjectMeta.Name, err) + return fmt.Errorf("Cannot create machine %s: %v", machine.ObjectMeta.Name, err) } klog.Infof("Successfully updated machine %s", currentMachine.ObjectMeta.Name) }