Skip to content

Commit

Permalink
Set default empty set for disks
Browse files Browse the repository at this point in the history
  • Loading branch information
Helen Hu committed Dec 6, 2024
1 parent 4552aa9 commit b034141
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/vm/vm_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/setdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
Expand Down Expand Up @@ -149,6 +150,7 @@ func (r *vmResource) Schema(ctx context.Context, req resource.SchemaRequest, res
},
"disks": schema.SetNestedAttribute{
Optional: true,
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Expand All @@ -163,6 +165,7 @@ func (r *vmResource) Schema(ctx context.Context, req resource.SchemaRequest, res
},
},
},
Default: setdefault.StaticValue(types.Set{}),
},
"fqdn": schema.StringAttribute{
Computed: true,
Expand Down

0 comments on commit b034141

Please sign in to comment.