Skip to content

Commit 557da95

Browse files
fix: avoid unknown quota allowance after updates (#57)
1 parent 3209c04 commit 557da95

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/provider/group_resource.go

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/hashicorp/terraform-plugin-framework/path"
1414
"github.com/hashicorp/terraform-plugin-framework/resource"
1515
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
16+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int32default"
1617
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1718
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
1819
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
@@ -82,6 +83,8 @@ func (r *GroupResource) Schema(ctx context.Context, req resource.SchemaRequest,
8283
"quota_allowance": schema.Int32Attribute{
8384
MarkdownDescription: "The number of quota credits to allocate to each user in the group.",
8485
Optional: true,
86+
Computed: true,
87+
Default: int32default.StaticInt32(0),
8588
},
8689
"organization_id": schema.StringAttribute{
8790
MarkdownDescription: "The organization ID that the group belongs to. Defaults to the provider default organization ID.",

internal/provider/group_resource_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func TestAccGroupResource(t *testing.T) {
6464

6565
t.Run("CreateImportUpdateReadOk", func(t *testing.T) {
6666
resource.Test(t, resource.TestCase{
67+
IsUnitTest: true,
6768
PreCheck: func() { testAccPreCheck(t) },
6869
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
6970
Steps: []resource.TestStep{
@@ -111,6 +112,7 @@ func TestAccGroupResource(t *testing.T) {
111112

112113
t.Run("CreateUnmanagedMembersOk", func(t *testing.T) {
113114
resource.Test(t, resource.TestCase{
115+
IsUnitTest: true,
114116
PreCheck: func() { testAccPreCheck(t) },
115117
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
116118
Steps: []resource.TestStep{

0 commit comments

Comments
 (0)