Skip to content

Commit

Permalink
upgrade pandora sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Dec 21, 2023
1 parent ab4f143 commit 8bcaac0
Show file tree
Hide file tree
Showing 38 changed files with 1,525 additions and 2,884 deletions.
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.LogAnalytics, err = loganalytics.NewClient(o); err != nil {
return fmt.Errorf("building clients for LogAnalytics: %+v", err)
}
client.LoadBalancers = loadbalancers.NewClient(o)
if client.LoadBalancers, err = loadbalancers.NewClient(o); err != nil {
return fmt.Errorf("building clients for LoadBalancers: %+v", err)
}
if client.Logic, err = logic.NewClient(o); err != nil {
return fmt.Errorf("building clients for Logic: %+v", err)
}
Expand Down
22 changes: 11 additions & 11 deletions internal/services/databricks/databricks_workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/databricks/2023-02-01/workspaces"
mlworkspace "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2023-04-01/workspaces"
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/loadbalancers"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/locks"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databricks/validate"
keyVaultParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/parse"
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
loadBalancerParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/parse"
loadBalancerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer/validate"
resourcesParse "github.com/hashicorp/terraform-provider-azurerm/internal/services/resource/parse"
storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -160,7 +159,7 @@ func resourceDatabricksWorkspace() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: loadBalancerValidate.LoadBalancerBackendAddressPoolID,
ValidateFunc: loadbalancers.ValidateLoadBalancerBackendAddressPoolID,
},

"custom_parameters": {
Expand Down Expand Up @@ -386,13 +385,13 @@ func resourceDatabricksWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta int
expandedTags := tags.Expand(d.Get("tags").(map[string]interface{}))

if backendPool != "" {
backendPoolId, err := loadBalancerParse.LoadBalancerBackendAddressPoolID(backendPool)
backendPoolId, err := loadbalancers.ParseLoadBalancerBackendAddressPoolID(backendPool)
if err != nil {
return err
}

// Generate the load balancer ID from the Backend Address Pool Id...
lbId := loadBalancerParse.NewLoadBalancerID(backendPoolId.SubscriptionId, backendPoolId.ResourceGroup, backendPoolId.LoadBalancerName)
lbId := loadbalancers.NewLoadBalancerID(backendPoolId.SubscriptionId, backendPoolId.ResourceGroupName, backendPoolId.LoadBalancerName)

backendPoolName = backendPoolId.BackendAddressPoolName
loadBalancerId = lbId.ID()
Expand All @@ -404,12 +403,13 @@ func resourceDatabricksWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta int
defer locks.UnlockByID(lbId.ID())

// check to make sure the load balancer exists as referred to by the Backend Address Pool...
lb, err := lbClient.Get(ctx, lbId.ResourceGroup, lbId.Name, "")
plbId := loadbalancers.ProviderLoadBalancerId{SubscriptionId: backendPoolId.SubscriptionId, ResourceGroupName: backendPoolId.ResourceGroupName, LoadBalancerName: backendPoolId.LoadBalancerName}
lb, err := lbClient.Get(ctx, plbId, loadbalancers.GetOperationOptions{})
if err != nil {
if utils.ResponseWasNotFound(lb.Response) {
return fmt.Errorf("load balancer %q for Backend Address Pool %q was not found", lbId, backendPoolId)
if response.WasNotFound(lb.HttpResponse) {
return fmt.Errorf("%s was not found", lbId)
}
return fmt.Errorf("failed to retrieve Load Balancer %q for Backend Address Pool %q: %+v", lbId, backendPoolId, err)
return fmt.Errorf("retrieving %s: %+v", lbId, err)
}
}

Expand Down Expand Up @@ -829,10 +829,10 @@ func flattenWorkspaceCustomParameters(input *workspaces.WorkspaceCustomParameter
parameters["virtual_network_id"] = v.Value
}

lbId, err := loadBalancerParse.LoadBalancerIDInsensitively(loadBalancerId)
lbId, err := loadbalancers.ParseLoadBalancerIDInsensitively(loadBalancerId)

if err == nil {
backendId := loadBalancerParse.NewLoadBalancerBackendAddressPoolID(lbId.SubscriptionId, lbId.ResourceGroup, lbId.Name, backendName)
backendId := loadbalancers.NewLoadBalancerBackendAddressPoolID(lbId.SubscriptionId, lbId.ResourceGroupName, lbId.LoadBalancerName, backendName)
backendAddressPoolId = backendId.ID()
}

Expand Down
Loading

0 comments on commit 8bcaac0

Please sign in to comment.