WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d5c17fd

Browse files
committed
fix: treat quota definitions as set
1 parent 68d006a commit d5c17fd

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/resources/platform.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ Required:
197197

198198
Optional:
199199

200-
- `contributing_workspaces` (List of String) A list of workspace identifiers that may contribute to this meshPlatform.
200+
- `contributing_workspaces` (Set of String) A list of workspace identifiers that may contribute to this meshPlatform.
201201
- `documentation_url` (String) URL for platform documentation.
202-
- `quota_definitions` (List of Object) List of quota definitions for the platform. (see [below for nested schema](#nestedatt--spec--quota_definitions))
202+
- `quota_definitions` (Set of Object) List of quota definitions for the platform. (see [below for nested schema](#nestedatt--spec--quota_definitions))
203203
- `support_url` (String) URL for platform support documentation.
204204

205205
<a id="nestedatt--spec--availability"></a>
@@ -212,7 +212,7 @@ Required:
212212

213213
Optional:
214214

215-
- `restricted_to_workspaces` (List of String) If the restriction is set to `RESTRICTED`, you can specify the workspace identifiers this meshPlatform is restricted to.
215+
- `restricted_to_workspaces` (Set of String) If the restriction is set to `RESTRICTED`, you can specify the workspace identifiers this meshPlatform is restricted to.
216216

217217

218218
<a id="nestedatt--spec--config"></a>

internal/provider/platform_resource.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/hashicorp/terraform-plugin-framework/resource"
1515
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
1616
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default"
17-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
1817
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
18+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/setdefault"
1919
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
2020
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
2121
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
@@ -188,12 +188,12 @@ func (r *platformResource) Schema(_ context.Context, _ resource.SchemaRequest, r
188188
},
189189
},
190190
},
191-
"contributing_workspaces": schema.ListAttribute{
191+
"contributing_workspaces": schema.SetAttribute{
192192
MarkdownDescription: "A list of workspace identifiers that may contribute to this meshPlatform.",
193193
ElementType: types.StringType,
194194
Optional: true,
195195
Computed: true,
196-
Default: listdefault.StaticValue(types.ListValueMust(types.StringType, []attr.Value{})),
196+
Default: setdefault.StaticValue(types.SetValueMust(types.StringType, []attr.Value{})),
197197
},
198198
"availability": schema.SingleNestedAttribute{
199199
MarkdownDescription: "Availability configuration for the meshPlatform.",
@@ -214,24 +214,24 @@ func (r *platformResource) Schema(_ context.Context, _ resource.SchemaRequest, r
214214
},
215215
},
216216
// TODO: check this is not empty if set to restricted and that it's set to the owner if private
217-
"restricted_to_workspaces": schema.ListAttribute{
217+
"restricted_to_workspaces": schema.SetAttribute{
218218
MarkdownDescription: "If the restriction is set to `RESTRICTED`, you can specify the workspace identifiers this meshPlatform is restricted to.",
219219
ElementType: types.StringType,
220220
Optional: true,
221221
Computed: true,
222-
Default: listdefault.StaticValue(types.ListValueMust(types.StringType, []attr.Value{})),
222+
Default: setdefault.StaticValue(types.SetValueMust(types.StringType, []attr.Value{})),
223223
},
224224
},
225225
},
226-
"quota_definitions": schema.ListAttribute{
226+
"quota_definitions": schema.SetAttribute{
227227
MarkdownDescription: "List of quota definitions for the platform.",
228228
Optional: true,
229229
Computed: true,
230230
Sensitive: false,
231231
ElementType: types.ObjectType{
232232
AttrTypes: quotaDefinitionAttrTypes,
233233
},
234-
Default: listdefault.StaticValue(types.ListValueMust(types.ObjectType{
234+
Default: setdefault.StaticValue(types.SetValueMust(types.ObjectType{
235235
AttrTypes: quotaDefinitionAttrTypes,
236236
}, []attr.Value{})),
237237
},

0 commit comments

Comments
 (0)