appoptics / terraform-provider-appoptics

Apache License 2.0
4 stars 2 forks source link

[alert] Disabling alert doesn't work #58

Closed poleszcz closed 1 year ago

poleszcz commented 1 year ago

After setting active to false alert stays enabled in AO and each time plan tries to disable it

  # appoptics_alert.example_alert will be updated in-place
  ~ resource "appoptics_alert" "example_alert" {
      ~ active        = true -> false
        id            = "109955884"
        name          = "example-alert"
        # (3 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }
poleszcz commented 1 year ago

Issue is caused by the way how json encoder handles false booleans... https://github.com/appoptics/appoptics-api-go/blob/0d52a6e35dd9872c96be9961c0474a8917e59415/alerts.go#L26 https://github.com/golang/go/issues/13284

False booleans are removed from struct and not encoded into http request.

poleszcz commented 1 year ago

Fixed with v0.5.2