Skip to content

Commit

Permalink
fix: [CDS-105804]: Add forceDelete for GitOps cluster resource (#1158)
Browse files Browse the repository at this point in the history
* fix: [CDS-105804]: Add forceDelete for GitOps cluster resource

* fix: [CDS-105804]: Add forceDelete for GitOps cluster resource

* fix: [CDS-105804]: Add forceDelete for GitOps cluster resource

* fix: [CDS-105804]: Add forceDelete for GitOps cluster resource
  • Loading branch information
mani5h-harness authored Jan 23, 2025
1 parent 3ab8016 commit 5204a20
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/resources/platform_gitops_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ resource "harness_platform_gitops_cluster" "example" {
- `account_id` (String, Deprecated) Account identifier of the GitOps cluster.
- `org_id` (String) Organization identifier of the cluster.
- `project_id` (String) Project identifier of the GitOps cluster.
- `force_delete` (Boolean) Indicates if the cluster should be deleted forcefully, regardless of existing applications using that repo.
- `request` (Block List, Max: 1) Cluster create or update request. (see [below for nested schema](#nestedblock--request))

### Read-Only
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/antihax/optional v1.0.0
github.com/aws/aws-sdk-go v1.46.4
github.com/docker/docker v24.0.5+incompatible
github.com/harness/harness-go-sdk v0.4.28
github.com/harness/harness-go-sdk v0.4.30
github.com/harness/harness-openapi-go-client v0.0.21
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/harness/harness-go-sdk v0.4.28 h1:Vlya0Q1odN3fb4FGMc9mOUcEK96i9tha0x9If4giCv8=
github.com/harness/harness-go-sdk v0.4.28/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
github.com/harness/harness-go-sdk v0.4.30 h1:/CEq337KYapoX9+OZzD+SM6PQ/+wftSOIML3SNqnF38=
github.com/harness/harness-go-sdk v0.4.30/go.mod h1:CPXydorp4zd5Dz2u2FXiHyWL4yd5PQafOMN69cgPSvk=
github.com/harness/harness-openapi-go-client v0.0.21 h1:VtJnpQKZvCAlaCmUPbNR69OT3c5WRdhNN5TOgUwtwZ4=
github.com/harness/harness-openapi-go-client v0.0.21/go.mod h1:u0vqYb994BJGotmEwJevF4L3BNAdU9i8ui2d22gmLPA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func ResourceGitopsCluster() *schema.Resource {
Required: true,
ForceNew: true,
},
"force_delete": {
Description: "Indicates if the cluster should be deleted forcefully, regardless of existing applications using that cluster.",
Type: schema.TypeBool,
Optional: true,
},
"request": {
Description: "Cluster create or update request.",
Type: schema.TypeList,
Expand Down Expand Up @@ -497,6 +502,8 @@ func resourceGitopsClusterDelete(ctx context.Context, d *schema.ResourceData, me
AccountIdentifier: optional.NewString(c.AccountId),
OrgIdentifier: optional.NewString(d.Get("org_id").(string)),
ProjectIdentifier: optional.NewString(d.Get("project_id").(string)),
ForceDelete: optional.NewBool(d.Get("force_delete").(bool)),
QueryServer: optional.NewString(d.Get("request.0.cluster.0.server").(string)),
})

if err != nil {
Expand Down

0 comments on commit 5204a20

Please sign in to comment.