From 632425a0b01cfe62a169b469b6a70b4ecf0f859a Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Wed, 31 Jul 2024 10:51:25 +0000 Subject: [PATCH] fix: avoid unknown quota allowance after updates --- internal/provider/group_resource.go | 3 +++ internal/provider/group_resource_test.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/internal/provider/group_resource.go b/internal/provider/group_resource.go index f396108..552a20e 100644 --- a/internal/provider/group_resource.go +++ b/internal/provider/group_resource.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int32default" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" @@ -82,6 +83,8 @@ func (r *GroupResource) Schema(ctx context.Context, req resource.SchemaRequest, "quota_allowance": schema.Int32Attribute{ MarkdownDescription: "The number of quota credits to allocate to each user in the group.", Optional: true, + Computed: true, + Default: int32default.StaticInt32(0), }, "organization_id": schema.StringAttribute{ MarkdownDescription: "The organization ID that the group belongs to. Defaults to the provider default organization ID.", diff --git a/internal/provider/group_resource_test.go b/internal/provider/group_resource_test.go index b049976..60b2e2d 100644 --- a/internal/provider/group_resource_test.go +++ b/internal/provider/group_resource_test.go @@ -64,6 +64,7 @@ func TestAccGroupResource(t *testing.T) { t.Run("CreateImportUpdateReadOk", func(t *testing.T) { resource.Test(t, resource.TestCase{ + IsUnitTest: true, PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccGroupResource(t *testing.T) { t.Run("CreateUnmanagedMembersOk", func(t *testing.T) { resource.Test(t, resource.TestCase{ + IsUnitTest: true, PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy