Skip to content

Commit

Permalink
internal/clients: updating the IsAzureStack check to use `go-azure-…
Browse files Browse the repository at this point in the history
…sdk`

I looked into removing the rest of the `authentication` package but it's needed until Giovanni's switched over to using `hashicorp/go-azure-sdk`
  • Loading branch information
tombuildsstuff committed May 8, 2023
1 parent 2d2e777 commit 47a900f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions internal/clients/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package clients
import (
"context"
"fmt"
"log"
"strings"
"log"

"github.com/hashicorp/go-azure-helpers/authentication"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
Expand Down Expand Up @@ -45,14 +44,7 @@ func Build(ctx context.Context, builder ClientBuilder) (*Client, error) {
var err error

// point folks towards the separate Azure Stack Provider when using Azure Stack
isAzureStack := false
if strings.EqualFold(builder.AuthConfig.Environment.Name, "AZURESTACKCLOUD") {
return nil, fmt.Errorf(azureStackEnvironmentError)
} else if isAzureStack, err = authentication.IsEnvironmentAzureStack(ctx, builder.MetadataHost, builder.AuthConfig.Environment.Name); err != nil { // TODO: consider updating this helper func
return nil, fmt.Errorf("unable to determine if environment is Azure Stack: %+v", err)
}

if isAzureStack {
if builder.AuthConfig.Environment.IsAzureStack() {
return nil, fmt.Errorf(azureStackEnvironmentError)
}

Expand Down

0 comments on commit 47a900f

Please sign in to comment.