Skip to content

Commit

Permalink
vmware: consolidating on/updating to API Version 2022-05-01 (#21458)
Browse files Browse the repository at this point in the history
* vendor: updating `vmware` to `2022-05-01`

* vmware: updating to API Version `2022-05-01`

* vmware: breaking changes in API version 2022-05-01
  • Loading branch information
tombuildsstuff authored Apr 19, 2023
1 parent ac81d1b commit ae2d233
Show file tree
Hide file tree
Showing 91 changed files with 483 additions and 91 deletions.
8 changes: 4 additions & 4 deletions internal/services/vmware/client/client.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package client

import (
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2021-12-01/datastores"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/datastores"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/services/vmware/validate/cluster_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package validate
import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/clusters"
)

func ClusterID(input interface{}, key string) (warnings []string, errors []error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package validate
import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/authorizations"
)

func ExpressRouteAuthorizationID(input interface{}, key string) (warnings []string, errors []error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/vmware/validate/private_cloud_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package validate
import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
)

func PrivateCloudID(input interface{}, key string) (warnings []string, errors []error) {
Expand Down
9 changes: 5 additions & 4 deletions internal/services/vmware/vmware_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"log"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/validate"
Expand Down Expand Up @@ -113,8 +114,8 @@ func resourceVmwareClusterCreate(d *pluginsdk.ResourceData, meta interface{}) er
Sku: clusters.Sku{
Name: d.Get("sku_name").(string),
},
Properties: clusters.ClusterProperties{
ClusterSize: int64(d.Get("cluster_node_count").(int)),
Properties: &clusters.CommonClusterProperties{
ClusterSize: pointer.To(int64(d.Get("cluster_node_count").(int))),
},
}

Expand Down
2 changes: 1 addition & 1 deletion internal/services/vmware/vmware_cluster_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/clusters"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/validate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/authorizations"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/authorizations"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
4 changes: 2 additions & 2 deletions internal/services/vmware/vmware_private_cloud.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package vmware

import (
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

func flattenPrivateCloudManagementCluster(input privateclouds.ManagementCluster) []interface{} {
func flattenPrivateCloudManagementCluster(input privateclouds.CommonClusterProperties) []interface{} {
return []interface{}{
map[string]interface{}{
"size": input.ClusterSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2021-12-01/datastores"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/clusters"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/datastores"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2021-12-01/datastores"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/datastores"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
19 changes: 12 additions & 7 deletions internal/services/vmware/vmware_private_cloud_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"log"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -220,9 +221,9 @@ func resourceVmwarePrivateCloudCreate(d *pluginsdk.ResourceData, meta interface{
Sku: privateclouds.Sku{
Name: d.Get("sku_name").(string),
},
Properties: privateclouds.PrivateCloudProperties{
ManagementCluster: privateclouds.ManagementCluster{
ClusterSize: int64(d.Get("management_cluster.0.size").(int)),
Properties: &privateclouds.PrivateCloudProperties{
ManagementCluster: privateclouds.CommonClusterProperties{
ClusterSize: pointer.To(int64(d.Get("management_cluster.0.size").(int))),
},
NetworkBlock: d.Get("network_subnet_cidr").(string),
Internet: &internet,
Expand All @@ -236,12 +237,16 @@ func resourceVmwarePrivateCloudCreate(d *pluginsdk.ResourceData, meta interface{
return fmt.Errorf("creating %s: %+v", id, err)
}

deadline, ok := ctx.Deadline()
if !ok {
return fmt.Errorf("internal-error: context had no deadline")
}
stateConf := &pluginsdk.StateChangeConf{
Pending: []string{string(privateclouds.PrivateCloudProvisioningStateBuilding)},
Target: []string{string(privateclouds.PrivateCloudProvisioningStateSucceeded)},
Refresh: privateCloudStateRefreshFunc(ctx, client, id),
MinTimeout: 15 * time.Second,
Timeout: d.Timeout(pluginsdk.TimeoutCreate),
Timeout: time.Until(deadline),
}

if _, err := stateConf.WaitForStateContext(ctx); err != nil {
Expand Down Expand Up @@ -331,8 +336,8 @@ func resourceVmwarePrivateCloudUpdate(d *pluginsdk.ResourceData, meta interface{
}

if d.HasChange("management_cluster") {
privateCloudUpdate.Properties.ManagementCluster = &privateclouds.ManagementCluster{
ClusterSize: int64(d.Get("management_cluster.0.size").(int)),
privateCloudUpdate.Properties.ManagementCluster = &privateclouds.CommonClusterProperties{
ClusterSize: pointer.To(int64(d.Get("management_cluster.0.size").(int))),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2020-03-20/privateclouds"
"github.com/hashicorp/go-azure-sdk/resource-manager/vmware/2022-05-01/privateclouds"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ae2d233

Please sign in to comment.