Skip to content

Commit

Permalink
Make new slack extension uses the computed AppUrl instead of previous…
Browse files Browse the repository at this point in the history
…ly defined constant
  • Loading branch information
jbfavre committed Oct 21, 2021
1 parent aef74d3 commit b1221fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pagerduty/resource_pagerduty_slack_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/heimweh/go-pagerduty/pagerduty"
)

const AppBaseUrl = "https://app.pagerduty.com"

func resourcePagerDutySlackConnection() *schema.Resource {
return &schema.Resource{
Create: resourcePagerDutySlackConnectionCreate,
Expand Down Expand Up @@ -175,9 +173,10 @@ func resourcePagerDutySlackConnectionRead(d *schema.ResourceData, meta interface
}

func resourcePagerDutySlackConnectionUpdate(d *schema.ResourceData, meta interface{}) error {
var c Config
config := &pagerduty.Config{
Token: os.Getenv("PAGERDUTY_USER_TOKEN"),
BaseURL: AppBaseUrl,
BaseURL: c.AppUrl,
}
client, err := pagerduty.NewClient(config)
if err != nil {
Expand Down Expand Up @@ -267,9 +266,10 @@ func flattenConfigList(list []string) interface{} {
}

func setClientConfig() *pagerduty.Config {
var c Config
return &pagerduty.Config{
Token: os.Getenv("PAGERDUTY_USER_TOKEN"),
BaseURL: AppBaseUrl,
BaseURL: c.AppUrl,
}
}

Expand Down

0 comments on commit b1221fd

Please sign in to comment.