Skip to content

Commit

Permalink
Merge branch 'master' into issue-805-filter-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
melonrush13 authored Mar 26, 2020
2 parents c14c66f + dee22f6 commit 75c2d8f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pkg/resourcemanager/resourcegroups/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package resourcegroups
import (
"context"
"fmt"
"net/http"

"github.com/Azure/azure-service-operator/api/v1alpha1"
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
Expand All @@ -29,19 +30,22 @@ func (g *AzureResourceGroupManager) Ensure(ctx context.Context, obj runtime.Obje
if err != nil {
instance.Status.Provisioned = false
instance.Status.Message = err.Error()

// handle special cases that won't work without a change to spec
if group.StatusCode == http.StatusBadRequest {
instance.Status.Provisioning = false
return true, nil
}

return false, fmt.Errorf("ResourceGroup create error %v", err)

}
if instance.Status.Provisioning {
instance.Status.Provisioned = true
instance.Status.Provisioning = false
instance.Status.Message = resourcemanager.SuccessMsg
} else {
instance.Status.Provisioned = false
instance.Status.Provisioning = true
}

instance.Status.Provisioned = true
instance.Status.Provisioning = false
instance.Status.Message = resourcemanager.SuccessMsg
instance.Status.ResourceId = *group.ID

return true, nil
}

Expand Down

0 comments on commit 75c2d8f

Please sign in to comment.