Skip to content

Commit

Permalink
fix: fix the tenants datasource blocks (#762)
Browse files Browse the repository at this point in the history
* Fix the tenants datasource blocks

* updated docs

---------

Co-authored-by: Ben Pearce <[email protected]>
  • Loading branch information
mcasperson and benPearce1 authored Aug 22, 2024
1 parent beb42f7 commit 6b47b61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/data-sources/tenants.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Provides information about existing tenants.
### Read-Only

- `id` (String) The unique ID for this resource.
- `tenants` (Block List) A list of tenants that match the filter(s). (see [below for nested schema](#nestedblock--tenants))
- `tenants` (Attributes List) (see [below for nested schema](#nestedatt--tenants))

<a id="nestedblock--tenants"></a>
<a id="nestedatt--tenants"></a>
### Nested Schema for `tenants`

Read-Only:
Expand Down
8 changes: 0 additions & 8 deletions octopusdeploy_framework/datasource_tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ func (*tenantsDataSource) Schema(_ context.Context, req datasource.SchemaRequest
resp.Schema = datasourceSchema.Schema{
Description: "Provides information about existing tenants.",
Attributes: schemas.GetTenantsDataSourceSchema(),
Blocks: map[string]datasourceSchema.Block{
"tenants": datasourceSchema.ListNestedBlock{
Description: "A list of tenants that match the filter(s).",
NestedObject: datasourceSchema.NestedBlockObject{
Attributes: schemas.GetTenantDataSourceSchema(),
},
},
},
}
}

Expand Down
7 changes: 7 additions & 0 deletions octopusdeploy_framework/schemas/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ func GetTenantsDataSourceSchema() map[string]datasourceSchema.Attribute {
"tags": util.GetQueryDatasourceTags(),
"space_id": GetSpaceIdDatasourceSchema("tenants", false),
"take": util.GetQueryTakeDatasourceSchema(),
"tenants": datasourceSchema.ListNestedAttribute{
Computed: true,
Optional: false,
NestedObject: datasourceSchema.NestedAttributeObject{
Attributes: GetTenantDataSourceSchema(),
},
},
}
}

Expand Down

0 comments on commit 6b47b61

Please sign in to comment.