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
6 changes: 6 additions & 0 deletions pkg/cloud/azure/actuators/machine/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-12-01/network"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/to"
machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
machinecontroller "github.com/openshift/machine-api-operator/pkg/controller/machine"
Expand Down Expand Up @@ -607,6 +608,11 @@ func (s *Reconciler) createVirtualMachine(ctx context.Context, nicName string) e
Namespace: s.scope.Machine.Namespace,
Reason: err.Error(),
})

var detailedError autorest.DetailedError
if errors.As(err, &detailedError) && detailedError.Message == "Failure sending request" {
return machinecontroller.InvalidMachineConfiguration("failure sending request for machine %s", s.scope.Machine.Name)
}
Comment on lines +612 to +615

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to see the actual error logged anywhere when this happens?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error will be returned by reconciler's Create(), I'd expect the machine controller to log it somewhere.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, wonder if there's any more information than Failure sending request that we could extract to improve the UX?

return fmt.Errorf("failed to create or get machine: %w", err)
}
} else if err != nil {
Expand Down