Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute - Upgrade API version from 2021-11-01 to 2024-03-01 #25436

Merged
merged 6 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.4.0
github.com/hashicorp/go-azure-helpers v0.66.2
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1093302
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1093302
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8=
github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953 h1:eoU9iMmWgufB441trZJ45TsZ+0vJ79vGKdBuVVYUXwI=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240321.1145953/go.mod h1:zvsDltRIRr58vA0EpSmY+a6NcgGirQE/u02Ag+D8jmM=
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953 h1:WAcSZL5+H9Z/DjUZ0x0sluNoEno/mD4b+NWpY04vJrw=
github.com/hashicorp/go-azure-sdk/sdk v0.20240321.1145953/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1093302 h1:AtAHa2q3KG/Oz0nDp9PR8fhI2dtFkZorx7ZjgmsuBR0=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240327.1093302/go.mod h1:zmhSjcxeEPZqWwaodNgi4FIVvHp3XlSGM5ZRPx8zcFw=
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1093302 h1:tBRiM5YKyyIBrJShk2Kmm/YwApJym9Mo5d2EvLVBfRI=
github.com/hashicorp/go-azure-sdk/sdk v0.20240327.1093302/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
2 changes: 1 addition & 1 deletion internal/services/compute/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhostgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/dedicatedhosts"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/sshpublickeys"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also update the other 2021-11-01 resources to use this updated API Version at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tombuildsstuff, I have upgraded other 2021-11-01 resources and the test coverage of compute is the same as the main branch. Could you kindly have another review? Thanks.

"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservationgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservations"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/images"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/gallerysharingupdate"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-03-01/virtualmachineruncommands"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/marketplaceordering/2015-06-01/agreements"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/hashicorp/terraform-provider-azurerm/utils"
Expand Down
2 changes: 1 addition & 1 deletion internal/services/compute/image_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/images"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/ssh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down
2 changes: 1 addition & 1 deletion internal/services/compute/no_downtime_resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"

Check failure on line 15 in internal/services/compute/no_downtime_resize.go

View workflow job for this annotation

GitHub Actions / golint

File is not `gofmt`-ed with `-s` (gofmt)
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks"
)

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

"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"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 Expand Up @@ -272,7 +272,7 @@ func (VirtualMachineDataDiskAttachmentResource) Destroy(ctx context.Context, cli
// fixes #1600
model.Resources = nil

if err := client.Compute.VirtualMachinesClient.CreateOrUpdateThenPoll(ctx, virtualMachineId, *model); err != nil {
if err := client.Compute.VirtualMachinesClient.CreateOrUpdateThenPoll(ctx, virtualMachineId, *model, virtualmachines.DefaultCreateOrUpdateOperationOptions()); err != nil {
return nil, fmt.Errorf("updating Virtual Machine %q: %+v", id, err)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/marketplaceordering/2015-06-01/agreements"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down
9 changes: 6 additions & 3 deletions internal/services/containers/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ type Client struct {
}

func NewContainersClient(o *common.ClientOptions) (*Client, error) {
containerInstanceClient := containerinstance.NewContainerInstanceClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&containerInstanceClient.Client, o.ResourceManagerAuthorizer)
containerInstanceClient, err := containerinstance.NewContainerInstanceClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Container Instance Runs Client: %+v", err)
}
o.Configure(containerInstanceClient.Client, o.Authorizers.ResourceManager)

containerRegistryClient_v2019_06_01_preview, err := containerregistry_v2019_06_01_preview.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
o.Configure(c, o.Authorizers.ResourceManager)
Expand Down Expand Up @@ -115,7 +118,7 @@ func NewContainersClient(o *common.ClientOptions) (*Client, error) {

return &Client{
AgentPoolsClient: agentPoolsClient,
ContainerInstanceClient: &containerInstanceClient,
ContainerInstanceClient: containerInstanceClient,
ContainerRegistryClient_v2021_08_01_preview: containerRegistryClient_v2021_08_01_preview,
ContainerRegistryClient_v2019_06_01_preview: containerRegistryClient_v2019_06_01_preview,
FleetUpdateRunsClient: fleetUpdateRunsClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"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-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/configurationassignments"
"github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"log"

"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/configurationassignments"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationrecoveryservicesproviders"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachines"

Check failure on line 20 in internal/services/recoveryservices/site_recovery_replicated_vm_resource.go

View workflow job for this annotation

GitHub Actions / golint

File is not `gofmt`-ed with `-s` (gofmt)
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservationgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks"
Expand Down

This file was deleted.

This file was deleted.

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.

Loading
Loading