From ccf1d36479ad5a5f2b98b1a749b23209583abe62 Mon Sep 17 00:00:00 2001 From: isaac Date: Fri, 16 Aug 2024 11:23:10 +0930 Subject: [PATCH] Remove retention policy from project group --- docs/data-sources/project_groups.md | 1 - docs/resources/project_group.md | 1 - .../datasource_project_groups.go | 9 +++---- .../schemas/project_group.go | 27 +++++-------------- 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/docs/data-sources/project_groups.md b/docs/data-sources/project_groups.md index ab1d0f4eb..f5a44f739 100644 --- a/docs/data-sources/project_groups.md +++ b/docs/data-sources/project_groups.md @@ -44,7 +44,6 @@ Optional: - `description` (String) The description of this project group. - `id` (String) The unique ID for this resource. -- `retention_policy_id` (String) The ID of the retention policy associated with this project group. - `space_id` (String) The space ID associated with this project group. Read-Only: diff --git a/docs/resources/project_group.md b/docs/resources/project_group.md index c0d250e03..d06af7575 100644 --- a/docs/resources/project_group.md +++ b/docs/resources/project_group.md @@ -30,7 +30,6 @@ resource "octopusdeploy_project_group" "example" { - `description` (String) The description of this project group. - `id` (String) The unique ID for this resource. -- `retention_policy_id` (String) The ID of the retention policy associated with this project group. - `space_id` (String) The space ID associated with this project group. ## Import diff --git a/octopusdeploy_framework/datasource_project_groups.go b/octopusdeploy_framework/datasource_project_groups.go index 9ff002e7c..6e647ca1a 100644 --- a/octopusdeploy_framework/datasource_project_groups.go +++ b/octopusdeploy_framework/datasource_project_groups.go @@ -33,11 +33,10 @@ func NewProjectGroupsDataSource() datasource.DataSource { func getNestedGroupAttributes() map[string]attr.Type { return map[string]attr.Type{ - "id": types.StringType, - "space_id": types.StringType, - "name": types.StringType, - "retention_policy_id": types.StringType, - "description": types.StringType, + "id": types.StringType, + "space_id": types.StringType, + "name": types.StringType, + "description": types.StringType, } } diff --git a/octopusdeploy_framework/schemas/project_group.go b/octopusdeploy_framework/schemas/project_group.go index 25406e96e..d683f018f 100644 --- a/octopusdeploy_framework/schemas/project_group.go +++ b/octopusdeploy_framework/schemas/project_group.go @@ -4,8 +4,6 @@ import ( "github.com/OctopusDeploy/terraform-provider-octopusdeploy/octopusdeploy_framework/util" datasourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" resourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -13,31 +11,18 @@ const projectGroupDescription = "project group" func GetProjectGroupDatasourceSchema() map[string]datasourceSchema.Attribute { return map[string]datasourceSchema.Attribute{ - "id": util.GetIdResourceSchema(), - "space_id": util.GetSpaceIdResourceSchema(projectGroupDescription), - "name": GetReadonlyNameDatasourceSchema(), - "retention_policy_id": datasourceSchema.StringAttribute{ - Computed: true, - Optional: true, - Description: "The ID of the retention policy associated with this project group.", - }, + "id": util.GetIdResourceSchema(), + "space_id": util.GetSpaceIdResourceSchema(projectGroupDescription), + "name": GetReadonlyNameDatasourceSchema(), "description": util.GetDescriptionResourceSchema(projectGroupDescription), } } func GetProjectGroupResourceSchema() map[string]resourceSchema.Attribute { return map[string]resourceSchema.Attribute{ - "id": util.GetIdResourceSchema(), - "space_id": util.GetSpaceIdResourceSchema(projectGroupDescription), - "name": util.GetNameResourceSchema(true), - "retention_policy_id": resourceSchema.StringAttribute{ - Computed: true, - Optional: true, - Description: "The ID of the retention policy associated with this project group.", - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - }, + "id": util.GetIdResourceSchema(), + "space_id": util.GetSpaceIdResourceSchema(projectGroupDescription), + "name": util.GetNameResourceSchema(true), "description": util.GetDescriptionResourceSchema(projectGroupDescription), } }