Skip to content

Commit

Permalink
Merge pull request hashicorp#21697 from hashicorp/refactor/stack-chec…
Browse files Browse the repository at this point in the history
…k-to-go-azure-sdk

internal/clients: updating the IsAzureStack check to use `go-azure-sdk`
  • Loading branch information
tombuildsstuff authored May 8, 2023
2 parents bba0d9c + b069467 commit d9870bc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/clients/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"log"
"strings"

"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 d9870bc

Please sign in to comment.