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

dependencies: updating to v0.20231106.1151347 of github.com/hashicorp/go-azure-sdk #23787

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/hashicorp/go-azure-helpers v0.63.0
github.com/hashicorp/go-azure-sdk v0.20231025.1113325
github.com/hashicorp/go-azure-sdk v0.20231106.1151347
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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.63.0 h1:7bYnYZsqzPjxVevi0z8Irwp5DwS8okLcaA183DQAcmY=
github.com/hashicorp/go-azure-helpers v0.63.0/go.mod h1:ELmZ65vzHJNTk6ml4jsPD+xq2gZb7t78D35s+XN02Kk=
github.com/hashicorp/go-azure-sdk v0.20231025.1113325 h1:LS2ZBtyK3cViLw2FQt11jm9YCdHRp2UQpe1pu5SKlZY=
github.com/hashicorp/go-azure-sdk v0.20231025.1113325/go.mod h1:3IQjdvuhEckMgdWpvQs4e4VdiiRLIm4z82kO814t/Lw=
github.com/hashicorp/go-azure-sdk v0.20231106.1151347 h1:K/9sLZafuu+xHSSUx+T3ZObUFwaJo+tl6p4ZxuU6q9k=
github.com/hashicorp/go-azure-sdk v0.20231106.1151347/go.mod h1:mdU6Hrw1jPiwBFmENOcjRlkMWi6yRI0Tt+p4vmPvc0g=
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
8 changes: 4 additions & 4 deletions internal/services/compute/gallery_application_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleries"
"github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplications"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate"
Expand Down Expand Up @@ -55,7 +55,7 @@ func (r GalleryApplicationResource) Arguments() map[string]*pluginsdk.Schema {
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: galleries.ValidateGalleryID,
ValidateFunc: commonids.ValidateSharedImageGalleryID,
},

"location": commonschema.Location(),
Expand Down Expand Up @@ -128,7 +128,7 @@ func (r GalleryApplicationResource) Create() sdk.ResourceFunc {
client := metadata.Client.Compute.GalleryApplicationsClient
subscriptionId := metadata.Client.Account.SubscriptionId

galleryId, err := galleries.ParseGalleryID(state.GalleryId)
galleryId, err := commonids.ParseSharedImageGalleryID(state.GalleryId)
if err != nil {
return err
}
Expand Down Expand Up @@ -203,7 +203,7 @@ func (r GalleryApplicationResource) Read() sdk.ResourceFunc {

state := &GalleryApplicationModel{
Name: id.ApplicationName,
GalleryId: galleries.NewGalleryID(id.SubscriptionId, id.ResourceGroupName, id.GalleryName).ID(),
GalleryId: commonids.NewSharedImageGalleryID(id.SubscriptionId, id.ResourceGroupName, id.GalleryName).ID(),
}

if model := resp.Model; model != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
Expand Down Expand Up @@ -58,7 +59,7 @@ func dataSourceSharedImageGalleryRead(d *pluginsdk.ResourceData, meta interface{
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id := galleries.NewGalleryID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))
id := commonids.NewSharedImageGalleryID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))
resp, err := client.Get(ctx, id, galleries.DefaultGetOperationOptions())
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
Expand Down
23 changes: 14 additions & 9 deletions internal/services/compute/shared_image_gallery_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
Expand All @@ -30,7 +31,7 @@ func resourceSharedImageGallery() *pluginsdk.Resource {
Update: resourceSharedImageGalleryUpdate,
Delete: resourceSharedImageGalleryDelete,
Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error {
_, err := galleries.ParseGalleryID(id)
_, err := commonids.ParseSharedImageGalleryID(id)
return err
}),

Expand Down Expand Up @@ -135,7 +136,7 @@ func resourceSharedImageGalleryCreate(d *pluginsdk.ResourceData, meta interface{
ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d)
defer cancel()

id := galleries.NewGalleryID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))
id := commonids.NewSharedImageGalleryID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))
existing, err := client.Get(ctx, id, galleries.DefaultGetOperationOptions())
if err != nil {
if !response.WasNotFound(existing.HttpResponse) {
Expand Down Expand Up @@ -166,8 +167,10 @@ func resourceSharedImageGalleryCreate(d *pluginsdk.ResourceData, meta interface{
}

if permission == galleries.GallerySharingPermissionTypesCommunity {
gallerySharingUpdateId := gallerysharingupdate.NewGalleryID(id.SubscriptionId, id.ResourceGroupName, id.GalleryName)
if err = gallerySharingUpdateClient.GallerySharingProfileUpdateThenPoll(ctx, gallerySharingUpdateId, gallerysharingupdate.SharingUpdate{OperationType: gallerysharingupdate.SharingUpdateOperationTypesEnableCommunity}); err != nil {
updatePayload := gallerysharingupdate.SharingUpdate{
OperationType: gallerysharingupdate.SharingUpdateOperationTypesEnableCommunity,
}
if err = gallerySharingUpdateClient.GallerySharingProfileUpdateThenPoll(ctx, id, updatePayload); err != nil {
return fmt.Errorf("enabling community sharing of %s: %+v", id, err)
}
}
Expand All @@ -182,7 +185,7 @@ func resourceSharedImageGalleryRead(d *pluginsdk.ResourceData, meta interface{})
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := galleries.ParseGalleryID(d.Id())
id, err := commonids.ParseSharedImageGalleryID(d.Id())
if err != nil {
return err
}
Expand Down Expand Up @@ -229,7 +232,7 @@ func resourceSharedImageGalleryUpdate(d *pluginsdk.ResourceData, meta interface{
ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := galleries.ParseGalleryID(d.Id())
id, err := commonids.ParseSharedImageGalleryID(d.Id())
if err != nil {
return err
}
Expand Down Expand Up @@ -268,7 +271,7 @@ func resourceSharedImageGalleryDelete(d *pluginsdk.ResourceData, meta interface{
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()

id, err := galleries.ParseGalleryID(d.Id())
id, err := commonids.ParseSharedImageGalleryID(d.Id())
if err != nil {
return err
}
Expand All @@ -281,8 +284,10 @@ func resourceSharedImageGalleryDelete(d *pluginsdk.ResourceData, meta interface{
if model := resp.Model; model != nil {
if prop := model.Properties; prop != nil && prop.SharingProfile != nil && prop.SharingProfile.Permissions != nil {
if pointer.From(prop.SharingProfile.Permissions) == galleries.GallerySharingPermissionTypesCommunity {
gallerySharingUpdateId := gallerysharingupdate.NewGalleryID(id.SubscriptionId, id.ResourceGroupName, id.GalleryName)
if err = gallerySharingUpdateClient.GallerySharingProfileUpdateThenPoll(ctx, gallerySharingUpdateId, gallerysharingupdate.SharingUpdate{OperationType: gallerysharingupdate.SharingUpdateOperationTypesReset}); err != nil {
updatePayload := gallerysharingupdate.SharingUpdate{
OperationType: gallerysharingupdate.SharingUpdateOperationTypesReset,
}
if err = gallerySharingUpdateClient.GallerySharingProfileUpdateThenPoll(ctx, *id, updatePayload); err != nil {
return fmt.Errorf("reseting community sharing of %s: %+v", id, err)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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/2022-03-03/galleries"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
Expand Down Expand Up @@ -142,7 +143,7 @@ func TestAccSharedImageGallery_privateGallery(t *testing.T) {
}

func (t SharedImageGalleryResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := galleries.ParseGalleryID(state.ID)
id, err := commonids.ParseSharedImageGalleryID(state.ID)
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/services/labservice/lab_service_plan_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"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/2022-03-03/galleries"
"github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2022-08-01/labplan"
azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
Expand Down Expand Up @@ -188,7 +187,7 @@ func (r LabServicePlanResource) Arguments() map[string]*pluginsdk.Schema {
"shared_gallery_id": {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: galleries.ValidateGalleryID,
ValidateFunc: commonids.ValidateSharedImageGalleryID,
},

"support": {
Expand Down

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

This file was deleted.

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

Loading
Loading