Skip to content

Commit

Permalink
addressing pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jpflueger committed Mar 27, 2020
1 parent 49b951e commit 02cbc9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ func (db *AzureSqlDbManager) Ensure(ctx context.Context, obj runtime.Object, opt
instance.Status.Message = err.Error()
azerr := errhelp.NewAzureErrorAzureError(err)

// resource request has been sent to ARM
if azerr.Type == errhelp.AsyncOpIncompleteError {
instance.Status.Provisioning = true
return false, nil
}

// the errors that can arise during reconcilliation where we simply requeue
catch := []string{
errhelp.ResourceGroupNotFoundErrorCode,
errhelp.ParentNotFoundErrorCode,
errhelp.AsyncOpIncompleteError,
}
if helpers.ContainsString(catch, azerr.Type) {
instance.Status.Provisioning = false
return false, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package azuresqlvnetrule
import (
"context"
"fmt"
"strings"

"github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql"
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
Expand Down Expand Up @@ -51,8 +50,8 @@ func (vr *AzureSqlVNetRuleManager) Ensure(ctx context.Context, obj runtime.Objec
instance.Status.Message = err.Error()
azerr := errhelp.NewAzureErrorAzureError(err)

if strings.Contains(azerr.Type, errhelp.AsyncOpIncompleteError) {
instance.Status.Provisioning = false
if azerr.Type == errhelp.AsyncOpIncompleteError {
instance.Status.Provisioning = true
instance.Status.Message = "Resource request submitted to Azure successfully"
return false, nil
}
Expand All @@ -66,6 +65,7 @@ func (vr *AzureSqlVNetRuleManager) Ensure(ctx context.Context, obj runtime.Objec
instance.Status.Provisioning = false
return false, nil
}

return false, err
}

Expand Down

0 comments on commit 02cbc9a

Please sign in to comment.