Skip to content

Commit 255764f

Browse files
authored
fix: [CDS-101017]: fix unsaved changes in plan for snow url without slash (#1115)
1 parent 1a9e879 commit 255764f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changelog/1115.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```relese-note:fix
2+
harness_platform_connector_service_now: omit difference of slash in service_now_url
3+
```

internal/service/platform/connector/service_now.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package connector
22

33
import (
44
"context"
5+
"strings"
56

67
"github.com/harness/harness-go-sdk/harness/nextgen"
78
"github.com/harness/terraform-provider-harness/helpers"
@@ -25,6 +26,11 @@ func ResourceConnectorServiceNow() *schema.Resource {
2526
Description: "URL of service now.",
2627
Type: schema.TypeString,
2728
Required: true,
29+
// Suppress the diff shown if the service_now_url are equal when both compared after removing / suffix if present.
30+
// API implementation returns url appended with /
31+
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
32+
return strings.TrimSuffix(old, "/") == strings.TrimSuffix(new, "/")
33+
},
2834
},
2935
"username": {
3036
Description: "Username to use for authentication.",

0 commit comments

Comments
 (0)