Skip to content

Commit

Permalink
fix: avoid unknown quota allowance after updates (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanndickson authored Aug 1, 2024
1 parent 3209c04 commit 557da95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/provider/group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.",
Expand Down
2 changes: 2 additions & 0 deletions internal/provider/group_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 557da95

Please sign in to comment.