From 110044e34a51dd36c2debcf307e23ee61439e0b1 Mon Sep 17 00:00:00 2001 From: jananivMS Date: Sun, 17 May 2020 22:57:24 -0600 Subject: [PATCH] fix VNet reconciler that causes mysql test failure --- pkg/resourcemanager/vnet/reconcile.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/resourcemanager/vnet/reconcile.go b/pkg/resourcemanager/vnet/reconcile.go index d1d9c3bd255..3df128fe98d 100644 --- a/pkg/resourcemanager/vnet/reconcile.go +++ b/pkg/resourcemanager/vnet/reconcile.go @@ -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" @@ -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