Skip to content

Commit

Permalink
fix: [CDS-69590]: Deprecated the description field (#561)
Browse files Browse the repository at this point in the history
* fix: [CDS-69590]: Deprecated the description field

* fix: [CDS-69590]: Deprecated the description field

* fix: [CDS-69590]: Deprecated the description field

* fix: [CDS-69590]: Deprecated the description field

* fix: [CDS-69590]: added the changelogs

* fix: [CDS-69590]: added the changelogs

* fix: [CDS-69590]: added the changelogs
  • Loading branch information
shivamnegi94 committed Jun 2, 2023
1 parent fda1583 commit edaa331
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .changelog/561.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/harness_platform_template - deprecated the field description from resource
```
14 changes: 7 additions & 7 deletions docs/resources/platform_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "harness_platform_template Resource - terraform-provider-harness"
subcategory: "Next Gen"
description: |-
Resource for creating a Template.
Resource for creating a Template. Description field is deprecated
---

# harness_platform_template (Resource)

Resource for creating a Template.
Resource for creating a Template. Description field is deprecated

## Example Usage

Expand Down Expand Up @@ -612,20 +612,20 @@ template:

### Required

- `identifier` (String) Unique identifier of the resource.
- `name` (String) Name of the resource.
- `identifier` (String) Unique identifier of the resource
- `name` (String) Name of the Variable
- `template_yaml` (String) Yaml for creating new Template. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
- `version` (String) Version Label for Template.

### Optional

- `comments` (String) Specify comment with respect to changes.
- `description` (String) Description of the resource.
- `description` (String, Deprecated) Description of the entity. Description field is deprecated
- `force_delete` (String) Enable this flag for force deletion of template
- `git_details` (Block List, Max: 1) Contains parameters related to creating an Entity for Git Experience. (see [below for nested schema](#nestedblock--git_details))
- `is_stable` (Boolean) True if given version for template to be set as stable.
- `org_id` (String) Unique identifier of the organization.
- `project_id` (String) Unique identifier of the project.
- `org_id` (String) Organization Identifier for the Entity
- `project_id` (String) Project Identifier for the Entity
- `tags` (Set of String) Tags to associate with the resource.

### Read-Only
Expand Down
39 changes: 35 additions & 4 deletions internal/service/platform/template/resource_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func ResourceTemplate() *schema.Resource {
resource := &schema.Resource{
Description: "Resource for creating a Template.",
Description: "Resource for creating a Template. Description field is deprecated",

ReadContext: resourceTemplateRead,
UpdateContext: resourceTemplateCreateOrUpdate,
Expand Down Expand Up @@ -116,11 +116,43 @@ func ResourceTemplate() *schema.Resource {
Optional: true,
Computed: true,
},
"identifier": {
Description: "Unique identifier of the resource",
Type: schema.TypeString,
Required: true,
},
"name": {
Description: "Name of the Variable",
Type: schema.TypeString,
Required: true,
},
"description": {
Description: "Description of the entity. Description field is deprecated",
Type: schema.TypeString,
Optional: true,
Deprecated: "description field is deprecated",
},
"org_id": {
Description: "Organization Identifier for the Entity",
Type: schema.TypeString,
Optional: true,
},
"project_id": {
Description: "Project Identifier for the Entity",
Type: schema.TypeString,
Optional: true,
},
"tags": {
Description: "Tags to associate with the resource.",
Type: schema.TypeSet,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Optional: true,
},
},
}

helpers.SetMultiLevelResourceSchema(resource.Schema)

return resource
}

Expand Down Expand Up @@ -489,7 +521,6 @@ func readTemplate(d *schema.ResourceData, template nextgen.TemplateWithInputsRes
d.Set("project_id", template.Template.Project)
d.Set("template_yaml", template.Template.Yaml)
d.Set("is_stable", template.Template.StableTemplate)
d.Set("description", template.Template.Description)
d.Set("version", template.Template.VersionLabel)
d.Set("comments", comments)
if template.Template.GitDetails != nil {
Expand Down
3 changes: 2 additions & 1 deletion internal/service/platform/template/resource_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestAccResourceTemplateProjectScope(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
ImportStateIdFunc: acctest.ProjectResourceImportStateIdFunc(resourceName),
ImportStateVerifyIgnore: []string{"git_details.0.commit_message", "git_details.0.connector_ref", "git_details.0.store_type", "comments"},
ImportStateVerifyIgnore: []string{"git_details.0.commit_message", "git_details.0.connector_ref", "git_details.0.store_type", "comments", "description"},
},
},
})
Expand Down Expand Up @@ -673,6 +673,7 @@ func testAccResourceTemplateProjectScope(id string, name string) string {
name = "%[2]s"
comments = "comments"
version = "ab"
description = "description"
is_stable = true
git_details {
branch_name = "main"
Expand Down

0 comments on commit edaa331

Please sign in to comment.