Skip to content

Commit

Permalink
Remove retention policy from project group
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacCalligeros95 committed Aug 16, 2024
1 parent d7fc15c commit 9f27509
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 112 deletions.
101 changes: 0 additions & 101 deletions octopusdeploy/schema_project_group.go

This file was deleted.

1 change: 0 additions & 1 deletion octopusdeploy_framework/datasource_project_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func (p *projectGroupsDataSource) Read(ctx context.Context, req datasource.ReadR
g.ID = types.StringValue(projectGroup.ID)
g.SpaceID = types.StringValue(projectGroup.SpaceID)
g.Name = types.StringValue(projectGroup.Name)
g.RetentionPolicyID = types.StringValue(projectGroup.RetentionPolicyID)
g.Description = types.StringValue(projectGroup.Description)
newGroups = append(newGroups, g)
}
Expand Down
9 changes: 3 additions & 6 deletions octopusdeploy_framework/resource_project_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ func (r *projectGroupTypeResource) Create(ctx context.Context, req resource.Crea
}

newGroup := projectgroups.ProjectGroup{
Name: data.Name.ValueString(),
Description: data.Description.ValueString(),
RetentionPolicyID: data.RetentionPolicyID.ValueString(),
SpaceID: data.SpaceID.ValueString(),
Name: data.Name.ValueString(),
Description: data.Description.ValueString(),
SpaceID: data.SpaceID.ValueString(),
}

group, err := projectgroups.Add(r.Config.Client, &newGroup)
Expand Down Expand Up @@ -98,7 +97,6 @@ func (r *projectGroupTypeResource) Update(ctx context.Context, req resource.Upda

group.Name = data.Name.ValueString()
group.Description = data.Description.ValueString()
group.RetentionPolicyID = data.RetentionPolicyID.ValueString()
group.SpaceID = data.SpaceID.ValueString()

updatedProjectGroup, err := projectgroups.Update(r.Config.Client, *group)
Expand Down Expand Up @@ -129,6 +127,5 @@ func updateProjectGroup(data *schemas.ProjectGroupTypeResourceModel, group *proj
data.ID = types.StringValue(group.ID)
data.Name = types.StringValue(group.Name)
data.SpaceID = types.StringValue(group.SpaceID)
data.RetentionPolicyID = types.StringValue(group.RetentionPolicyID)
data.Description = types.StringValue(group.Description)
}
7 changes: 3 additions & 4 deletions octopusdeploy_framework/schemas/project_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ func GetProjectGroupResourceSchema() map[string]resourceSchema.Attribute {
}

type ProjectGroupTypeResourceModel struct {
Name types.String `tfsdk:"name"`
SpaceID types.String `tfsdk:"space_id"`
Description types.String `tfsdk:"description"`
RetentionPolicyID types.String `tfsdk:"retention_policy_id"`
Name types.String `tfsdk:"name"`
SpaceID types.String `tfsdk:"space_id"`
Description types.String `tfsdk:"description"`

ResourceModel
}

0 comments on commit 9f27509

Please sign in to comment.