Skip to content

Commit dfc05e1

Browse files
committed
use namespace_id
1 parent ec35d5c commit dfc05e1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

internal/provider/policies_data_source.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ type PoliciesDataSource struct {
2525
}
2626

2727
type PoliciesDataSourceModel struct {
28-
Namespace types.String `tfsdk:"namespace"`
29-
Query types.String `tfsdk:"query"`
30-
Offset types.Int64 `tfsdk:"offset"`
31-
Limit types.Int64 `tfsdk:"limit"`
32-
OrderBy types.String `tfsdk:"order_by"`
33-
Policies []PolicyModel `tfsdk:"policies"`
34-
TotalCount types.Int64 `tfsdk:"total_count"`
28+
NamespaceID types.String `tfsdk:"namespace_id"`
29+
Query types.String `tfsdk:"query"`
30+
Offset types.Int64 `tfsdk:"offset"`
31+
Limit types.Int64 `tfsdk:"limit"`
32+
OrderBy types.String `tfsdk:"order_by"`
33+
Policies []PolicyModel `tfsdk:"policies"`
34+
TotalCount types.Int64 `tfsdk:"total_count"`
3535
}
3636

3737
func (d *PoliciesDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) {
@@ -43,7 +43,7 @@ func (d *PoliciesDataSource) Schema(_ context.Context, _ datasource.SchemaReques
4343
MarkdownDescription: "List all policies",
4444

4545
Attributes: map[string]schema.Attribute{
46-
"namespace": schema.StringAttribute{
46+
"namespace_id": schema.StringAttribute{
4747
Optional: true,
4848
Description: "Namespace to list policies in.",
4949
},
@@ -145,7 +145,7 @@ func (d *PoliciesDataSource) Read(ctx context.Context, req datasource.ReadReques
145145
}
146146

147147
listReq := &pb.ListPoliciesRequest{
148-
Namespace: data.Namespace.ValueString(),
148+
Namespace: data.NamespaceID.ValueString(),
149149
Query: data.Query.ValueStringPointer(),
150150
Offset: data.Offset.ValueInt64Pointer(),
151151
Limit: data.Limit.ValueInt64Pointer(),

0 commit comments

Comments
 (0)