Skip to content

Commit

Permalink
fix escalation repeat field (opsgenie#348)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhat Buyukcelebi <[email protected]>
  • Loading branch information
Serhatkemal and sbuyukcelebi authored Nov 23, 2022
1 parent 22a6cc7 commit 305103d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.18 (November 16, 2022)
BUGFIX:
* **Escalation:** Import repeat field bug fixed.

## 0.6.11 (February 18, 2022)
* fix team set problem

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/hashicorp/go-retryablehttp v0.6.6
github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.0
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.11-0.20220210080402-2a8f79978ae0
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.14
github.com/pkg/errors v0.9.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.11-0.20220210080402-2a8f79978ae0 h1:qlSiuCdXCgw/fwoQA+SV2Ek3peiq6G9cR9meP1Ux8Ys=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.11-0.20220210080402-2a8f79978ae0/go.mod h1:4OjcxgwdXzezqytxN534MooNmrxRD50geWZxTD7845s=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.14 h1:ni+M5q9QIZQq5xQiYzbttDZpPQogPWx8MdHpvZtWcTE=
github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.14/go.mod h1:4OjcxgwdXzezqytxN534MooNmrxRD50geWZxTD7845s=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
5 changes: 2 additions & 3 deletions opsgenie/resource_opsgenie_escalation.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ func resourceOpsgenieEscalationRead(d *schema.ResourceData, meta interface{}) er
d.Set("name", getResponse.Name)
d.Set("description", getResponse.Description)
d.Set("rules", flattenOpsgenieEscalationRules(getResponse.Rules))
repeat := d.Get("repeat").([]interface{})
if len(repeat) > 0 {
if getResponse.Repeat != nil {
d.Set("repeat", flattenOpsgenieEscalationRepeat(getResponse.Repeat))
}
if getResponse.OwnerTeam != nil {
Expand Down Expand Up @@ -237,7 +236,7 @@ func flattenOpsgenieEscalationRules(input []escalation.Rule) []map[string]interf
return rules
}

func flattenOpsgenieEscalationRepeat(input escalation.Repeat) []map[string]interface{} {
func flattenOpsgenieEscalationRepeat(input *escalation.Repeat) []map[string]interface{} {
repeats := make([]map[string]interface{}, 0, 1)
out := make(map[string]interface{})
out["count"] = input.Count
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 20 additions & 14 deletions vendor/github.com/opsgenie/opsgenie-go-sdk-v2/client/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ github.com/mitchellh/reflectwalk
# github.com/oklog/run v1.0.0
## explicit
github.com/oklog/run
# github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.11-0.20220210080402-2a8f79978ae0
# github.com/opsgenie/opsgenie-go-sdk-v2 v1.2.14
## explicit; go 1.12
github.com/opsgenie/opsgenie-go-sdk-v2/alert
github.com/opsgenie/opsgenie-go-sdk-v2/client
Expand Down

0 comments on commit 305103d

Please sign in to comment.