Skip to content

Commit

Permalink
fix VNet reconciler that causes mysql test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jananivMS committed May 18, 2020
1 parent 4c80339 commit 110044e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pkg/resourcemanager/vnet/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"strings"

"github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network"
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
"github.com/Azure/azure-service-operator/pkg/errhelp"
"github.com/Azure/azure-service-operator/pkg/helpers"
Expand All @@ -35,13 +36,15 @@ func (g *AzureVNetManager) Ensure(ctx context.Context, obj runtime.Object, opts
// consider the reconcilliation successful
vNet, err := g.GetVNet(ctx, resourceGroup, resourceName)
if err == nil {
// succeeded! end reconcilliation successfully
instance.Status.Provisioning = false
instance.Status.Provisioned = true
instance.Status.FailedProvisioning = false
instance.Status.Message = resourcemanager.SuccessMsg
instance.Status.ResourceId = *vNet.ID
return true, nil
if vNet.ProvisioningState == network.Succeeded {
// succeeded! end reconcilliation successfully
instance.Status.Provisioning = false
instance.Status.Provisioned = true
instance.Status.FailedProvisioning = false
instance.Status.Message = resourcemanager.SuccessMsg
instance.Status.ResourceId = *vNet.ID
return true, nil
}
}

instance.Status.Provisioning = true
Expand Down

0 comments on commit 110044e

Please sign in to comment.